DataGridView: Skip ReadOnly cells

  • Thread starter Thread starter osmarjunior
  • Start date Start date
O

osmarjunior

I have a DataGridView with some read-only cells.
I want it skips these cells when the user press Tab or Shift+Tab keys.
How can I do this?

Thanks.

Junior.
 
Junior,

You will have to handle the tabbing for the grid, most likely overriding
the ProcessTabKey method on the grid. You will have to determine which
direction to proceed (what if the ALT key is pressed as well, you need to
tab backwards).

I would look at reflector to look at the ProcessTabKey method, and also
the TabToNextCell and TabToPreviousCell methods for guidance on how to find
the next cell. It's not a simple task, but it does look doable.

Hope this helps.
 

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