其中一個GridView列必須存儲Panel控件(其中包含一些控件)。問題是,該代碼不起作用,我的意思是,Panel不出現在列中。GridView列中沒有出現Panel控件
Panel myPanel = new Panel();
LinkButton zatw = new LinkButton();
zatw.CommandName = "Accept";
zatw.Text = "Accept";
LinkButton odrz = new LinkButton();
odrz.CommandName = "Deny";
odrz.Text = "Deny";
myPanel.Controls.Add(zatw);
myPanel.Controls.Add(odrz);
DataTable DT = new DataTable();
DT.Columns.Add("Options", typeof(Panel));
DataRow myRow = DT.NewRow();
myRow1[0] = myPanel;
DT.Rows.Add(myRow1);
GridView1.DataSource = DT;
GridView1.DataBind();
...