Question CellDoubleClick for DataGridviewColumn

boomboombugsh

Member
Joined
Dec 30, 2011
Messages
5
Programming Experience
Beginner
Hi guys :)


I Have a DataGridView and I want to hide other columns when I doubleclick a certain column.
Im doing it through this code


Private Sub DataGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles DataGridView1.CellDoubleClick
DataGridView1.Columns("Column1").IsVisible = False
DataGridView1.Columns("Column2").IsVisible = False
End Sub


But the problem is that I want to use this event when is certain column is doubleclicked and not for all columns. I want this code to run when I double clicked on column5 for example.
How do I know if the user clicked on a certain column?


Any help would be appreciated in this regard.


Thanks :)
 
Thanks for your immediate response :)
My problem was solved already
through the event called

Private Sub DataGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles DataGridView1.CellDoubleClick
if e.columnindex = Convert.ToInt16(Me.DataGridView1.Columns("Quiz").Index) then
DataGridView1.Columns("Quiz1").IsVisible = True
End If
Oh Yes Im using a Telerik radtools, a third party gridview control.
 
Back
Top