This is a migrated thread and some comments may be shown as answers.

CellDoubleClick for RadGridviewColumn

3 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Empanada
Top achievements
Rank 1
Empanada asked on 31 Dec 2011, 04:12 AM
Hi guys :)

I Have a Radgridview  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.

Im using vb.net and totally new to telerik controls

Any help would be appreciated in this regard.

Thanks :)

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 03 Jan 2012, 01:08 PM
Hello Empanada,

Thank you for writing.

What you can do is to get the Column.Name from the event arguments and perform your logic only if a specified column is clicked:
If e.Column.Name = "column5" Then
'your logic here
End If

I hope you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
All the best,
Stefan
the Telerik team

SP1
of Q3’11 of RadControls for WinForms is available for download (see what's new).
0
Empanada
Top achievements
Rank 1
answered on 11 Jan 2012, 01:59 PM
Thanks :)
It really helped me a lot :)
0
Stefan
Telerik team
answered on 16 Jan 2012, 11:40 AM
I am glad that I could help. Feel free to write back if you have any other questions.

All the best,
Stefan
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Tags
GridView
Asked by
Empanada
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Empanada
Top achievements
Rank 1
Share this question
or