|
-
May 5th, 2007, 12:14 PM
#1
Thread Starter
Lively Member
[RESOLVED] [2005] Making the cells in a DGV unselectable
I am using a DGV to display data from a table but I've been unable to figure out how to prevent the user from clicking on a cell and selecting it. I'd use DataGridView.Enabled = False if it also didn't prevent the use of the scroll bar.
I also checked out the DataGridView.SetStyle(Selectable, False) member but that is protected so I can't touch it. Does anyone have any suggestions?
I've disabled all editing abilities (adding, deleting, reordering, etc) for it. It has to be something trivial I am completely missing and I fear a serious "DOH!" moment as soon as the solution is posted.
Gr,
Mightor
What the world needs is more geniuses with humility, there are so few of us left.
If my post was accidentally useful, please rate it as such, thanks!
Mon aéroglisseur est plein des anguilles.
-
May 5th, 2007, 12:17 PM
#2
Re: [2005] Making the cells in a DGV unselectable
-
May 5th, 2007, 12:21 PM
#3
Thread Starter
Lively Member
Re: [2005] Making the cells in a DGV unselectable
 Originally Posted by stimbo
ReadOnly = True ??
I can still select the cells and rows with that set to True.
Gr,
Mightor
What the world needs is more geniuses with humility, there are so few of us left.
If my post was accidentally useful, please rate it as such, thanks!
Mon aéroglisseur est plein des anguilles.
-
May 5th, 2007, 02:02 PM
#4
Thread Starter
Lively Member
Re: [2005] Making the cells in a DGV unselectable
This did the trick for me:
vb Code:
Private Sub DataGridView3_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView3.SelectionChanged
DataGridView3.CurrentCell.Selected = False
End Sub
Works a treat.
Gr,
Mightor
What the world needs is more geniuses with humility, there are so few of us left.
If my post was accidentally useful, please rate it as such, thanks!
Mon aéroglisseur est plein des anguilles.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|