I need to add a checkbox control insida a datatalbe. then i binded this datatable to the gridview control.
The following code i used
Datatable dt=new Datatable();
dt.columns.add("Action");
dt.Rows.Add(typeof(CheckBox));
grdi1.datasource=dt;
grid1.databind();
When i used the code like this, in runtime instead of getting a checkbox i’m getting
System.Web.UI.WebControls.CheckBox in the column specified.
How i need to achieve to get a checkbox inside a datatable.
Thanks in Advance!
you need to specify boolean type column field when you add column to datatable, specify either 0 or 1 while adding rows. following code may work.