CellDoubleClick for RadGridviewColumn

4 posts, 1 answers
  1. Empanada
    Empanada avatar
    6 posts
    Member since:
    Sep 2011

    Posted 30 Dec 2011 Link to this post

    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 :)
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 03 Jan 2012 Link to this post

    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).
  3. Empanada
    Empanada avatar
    6 posts
    Member since:
    Sep 2011

    Posted 11 Jan 2012 Link to this post

    Thanks :)
    It really helped me a lot :)
  4. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 16 Jan 2012 Link to this post

    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).

Back to Top