Add button column to datatable
c#, c#-4.0, datatable
Solution
Add Buttoncolumn in DataTable its wired ...thats not possible at all...
The DataTable DataColumn DataType property supports the following base .NET Framework data types:
- Boolean
- Byte
- Char
- DateTime
- Decimal
- Double
- Int16
- Int32
- Int64
- SByte
- Single
- String
- TimeSpan
- UInt16
- UInt32
- UInt64
Sample code to add coplumn
DataTable workTable = new DataTable("Customers");
DataColumn workCol = workTable.Columns.Add("CustID", typeof(Int32));
workCol.AllowDBNull = true;
Problem
I am trying to insert a button column into a datatable but it says that its an error. Any help pleasE? ``` ButtonColumn col = new ButtonColumn(); col.CommandName = "select"; col.ButtonType = ButtonColumnType.LinkButton; col.HeaderText = "Edit"; dt.Columns.Add(col); ```