The following example demonstrates how to fix the ShipCountry and ShipCity columns.
XAML |
Copy Code |
---|---|
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"> <Grid.Resources> <xcdg:DataGridCollectionViewSource x:Key="cvs_orders" Source="{Binding Source={x:Static Application.Current}, Path=Orders}"/> </Grid.Resources> <xcdg:DataGridControl x:Name="OrdersGrid" ItemsSource="{Binding Source={StaticResource cvs_orders}}"> <xcdg:DataGridControl.Columns> <xcdg:Column FieldName="ShipCountry" VisiblePosition="0"/> <xcdg:Column FieldName="ShipCity" VisiblePosition="1"/> </xcdg:DataGridControl.Columns> <xcdg:DataGridControl.View> <xcdg:TableView FixedColumnCount="2"/> </xcdg:DataGridControl.View> </xcdg:DataGridControl> </Grid> |
VB.NET |
Copy Code |
---|---|
dataGridControl.Columns( "ShipCountry" ).VisiblePosition = 0 dataGridControl.Columns( "ShipCity" ).VisiblePosition = 0 Dim view As New TableView() view.FixedColumnCount = 2 dataGridControl.View = view |
C# |
Copy Code |
---|---|
dataGridControl.Columns[ "ShipCountry" ].VisiblePosition = 0; dataGridControl.Columns[ "ShipCity" ].VisiblePosition = 0; TableView view = new TableView(); view.FixedColumnCount = 2; dataGridControl.View = view; |