How can I make datagridview can only select the cells in the same column at a time?
Posted
by MemoryLeak
on Stack Overflow
See other posts from Stack Overflow
or by MemoryLeak
Published on 2010-03-20T13:45:08Z
Indexed on
2010/03/20
13:51 UTC
Read the original article
Hit count: 392
I am using winforms to develop my application. And I set my datagridview control's selectionmode to "CellSelect", and this allow the user to select as many cells as he want which spread over several columns; but I want to constraint my user can only select cells in single column at a time, and there isn't any such kind of selectionmode for me.
So If I want to implement this, how can I extend the datagridview class ? I also think that I can check in eventhandler whenever the selection cells are changed, through which I might make the user can not select cells spread over multiple columns, but this is not that good, I think.
Can any other people help me to find out a better solution ?
© Stack Overflow or respective owner