Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CheckBox In DataGridView
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01441085
Message ID:
01441095
Vues:
31
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcheckboxcolumn.aspx
Not sure how you can use this if you're letting the table dictate the grid columns tho.......

>I'm not. how do I?
>
>>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????
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform