שלום לכולם - שאלה על DataGrid
ובכן, אני יוצרת DataGrid דרך הקוד ואני רוצה שהעמודה הראשונה תהיה מסוג LinkButton. הקוד:
ובכן, אני יוצרת DataGrid דרך הקוד ואני רוצה שהעמודה הראשונה תהיה מסוג LinkButton. הקוד:
DataTable theTable = new DataTable(""); theTable.Columns.Add(new DataColumn("Name", typeof(String))); theTable.Columns.Add(new DataColumn("Address",typeof(String))); DataSet ds=new DataSet(); ds.Tables.Add(theTable); DataRow Row; for (int i=0;i<10;i++) { Row = ds.Tables[0].NewRow(); Row[0]="Name"+i.ToString(); Row[1]="Address"+i.ToString(); ds.Tables[0].Rows.Add(Row); } DataView dv =new DataView(ds.Tables[0]); DataGrid1.DataSource = dv; DataGrid1.DataBind();
ניסיתי לכתוב:LinkButton LB=new LinkButton(); LB.Text]="Name"+i.ToString(); Row[0]=LB;
וגם להחליף את הtypeof של השורה ל-LinkButton אבל זה לא עוזר כלום. יש למישהו רעיון? תודה רבה