I have a checkbox list and need to add the DataTextField from a dataTable
how to I add the column names to the Checkbox List DataTextField control?
// Iterate through your values
foreach (DataColumn dc in dt.Columns)
{
chkShowHideCol.DataTextField = dc.ColumnName; <-- I need to add the column name for the datafield and valuefield.
chkShowHideCol.DataValueField = dc.ColumnName;
}
chkShowHideCol.DataSource = dt;
chkShowHideCol.DataBind();
Go to the complete details ...