Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CheckBox In DataGridView
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01441085
Message ID:
01441091
Views:
35
Where are you setting the column type to DataGridViewCheckBoxColumn ?

>Why is it so blasted difficult to add controls in DataGridView columns??? I gave up trying to add a combo. Now I would like to add a checkbox column.
>
>Anway... I am creating the data table that is bound to the grid in code:
>
>
>DataTable table = new DataTable();
>table.Columns.Add("ColumnId", typeof(int));
>table.Columns.Add("QueryId", typeof(int));
>table.Columns.Add("TableId", typeof(int));
>table.Columns.Add("TableName", typeof(string));
>table.Columns.Add("ApexColumnName", typeof(string));
>table.Columns.Add("Expression", typeof(string));
>table.Columns.Add("MyCheckBox", typeof(bool));
>
>dsGrid.Tables.Add(table);
>
>grdData.DataMember = dsGrid.Tables[0].TableName;
>grdData.DataSource = dsGrid.Tables[0];
>
>grdData.Columns["ColumnId"].Visible = false;
>grdData.Columns["QueryId"].Visible = false;
>grdData.Columns["TableId"].Visible = false;
>grdData.Columns["TableName"].Width = 200;
>grdData.Columns["ApexColumnName"].Width = 200;
>grdData.Columns["Expression"].Width = 290;
>
>
>Notice the 'MyCheckBox' column. This created the CheckBox column in the grid, but when I click it, nothinghappens. No checkmark appears.
>
>What is wrong here????
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform