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

Monitor column visible state changed in ColumnChooser

3 Answers 225 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 15 Jan 2011, 04:48 PM
Hi,

I have a problem with ColumnChooser in RadGridView.

Please tell me how can I monitor when column visible state changed (For example when I drag and drop column from ColumnChooser to RadGridView or double click on it) ? 

There may be some event ? 


Any help would be appreciated!

Regards!

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 15 Jan 2011, 05:33 PM
Hello Pavel,

This should work for you.
Create an event handler for each of the column to monitor the RadPropertyChanged event
For Each c As GridViewDataColumn In Me.RadGridView1.Columns
    AddHandler c.RadPropertyChanged, AddressOf Column_RadPropertyChanged
Next

...and then you can find out information about the column
Private Sub Column_RadPropertyChanged(ByVal sender As Object, ByVal e As RadPropertyChangedEventArgs)
    If String.Equals(e.Property.Name, "IsVisible") Then
        Dim column As GridViewDataColumn = CType(sender, GridViewDataColumn)
        MessageBox.Show(column.Name & " visibility changed to: " & column.IsVisible.ToString())
    End If
End Sub

Hope that helps
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 17 Jan 2011, 02:39 PM
Hello,

Did this help? If so please remember to mark as answer. If you need more informaton, let me know
Thanks
Richard
0
Pavel
Top achievements
Rank 1
answered on 17 Jan 2011, 03:55 PM

Hi ! 

It works. Richard thanks a lot for your help. 

Regards!

Tags
GridView
Asked by
Pavel
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Pavel
Top achievements
Rank 1
Share this question
or