How do I go about adding a ButtonColumn to a DataTable.
I am basically using a DataTable as the DataSource of a DataGrid and need to add a ButtonColumn to the DataTable so that when I DataBind it to the DataGrid it all works.
Although when I try
dt.Columns.Add(buttonColumn)
This is not allowed. It has to be a basic DataColumn.
Thanks in advance, I know it’s a simple question so shouldn’t be hard to answer.
You can’t add a
ButtonColumntoDataTables. Instead, you add theButtonColumnto theDataGrid(front side or back side) and define its bind (with theDataFieldproperty) to a column in theDataTable.