This example demonstrates how to create an event that is raised when a user changes the GridControl's layout.
In this example, the GridLayoutHelper
class handles changes of the GridControl and GridColumn layout properties and raises a custom event. The event's handler logs layout changes in the Output window:
The following code sample demonstrates how to attach the GridLayoutHelper
class to the GridControl:
<dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
<dxmvvm:Interaction.Behaviors>
<local:GridLayoutHelper LayoutChanged="GridLayoutHelper_Trigger"/>
</dxmvvm:Interaction.Behaviors>
</dxg:GridControl>
- GridLayoutHelper.cs (VB: GridLayoutHelper.vb)
- PropertyChangeNotifier.cs (VB: PropertyChangeNotifier.vb)
- MainWindow.xaml (VB: MainWindow.xaml)
- MainWindow.xaml.cs (VB: MainWindow.xaml.vb)
- GridControl.Columns
- GridControl.SortInfo
- DataControlBase.FilterChanged
- BaseColumn.ActualWidth
- BaseColumn.VisibleIndex
- GridColumn.GroupIndex
- BaseColumn.Visible
(you will be redirected to DevExpress.com to submit your response)