Disabling a column in DataGridView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Has anybody found a way to disable a column in DataGridView i.e prevent it
being selected. With DataGrid it was fairly easy to check on the column being
entered and move the selection to the next column, this does not seem
possible with DataGridView.
 
Handle the DataGridView.ColumnStateChanged event. The event passes an
instance of DataGridViewcolumnStateChangedEventArgs, which includes a
reference to the Column, as well as the type of state that has changed. You
can then set the Selected property of the Column to false.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 
Thanks had to use CellStateChanged to avoid selection of individual cells,
but that worked perfectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top