I have a datagrid with a set of columns showing data from a database. I create the datatable and add it to the datagrid and then bind the source. this works great and now I would like to add a column to the front of the grid that has checkbox in it.
Do I add the checkbox when I am adding the new row to the datatable that is shown in the datagrid or after I databind the datatable to the datagrid?
Using: VB.Net, Visual Studio 2012
Best Answer
you can add checkbox using template field
Set AutoGenerateColumns attribute to false.
Add Column tag to asp:DataGrid tag.
Now add itemtemplate inside columns
and if you want to attach it to datatable column then u have to add like this