ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Controlling Grid Interaction > Preventing Users from Splitting the Grid

Preventing Users from Splitting the Grid

You can prevent users from creating and sizing splits by using the AllowHorizontalSplit, AllowHorizontalSplitSizing, AllowVerticalSplit, and AllowVerticalSplitSizing properties. The properties are all set to True by default to allow users to create and size splits at run time.

In XAML

Set the AllowHorizontalSplit and the AllowVerticalSplit properties to False to prevent users from creating horizontal and vertical splits. For example, use the following XAML to prevent users from creating splits:

<c1grid:C1DataGrid Name="c1DataGrid1" AllowHorizontalSplit="False" AllowVerticalSplit="False">

Set the AllowHorizontalSplitSizing and AllowVerticalSplit properties to False to prevent users from sizing horizontal and vertical splits. For example, use the following XAML to prevent users from sizing splits:

<c1grid:C1DataGrid Name="c1DataGrid1" AllowVerticalSplitSizing="False" AllowHorizontalSplitSizing="False">

In Code

Set the AllowHorizontalSplit and the AllowVerticalSplit properties to False to prevent users from creating horizontal and vertical splits. For example, use the following code to prevent users from creating splits:

      Visual Basic

C1DataGrid1.AllowHorizontalSplit = False

C1DataGrid1.AllowVerticalSplit = False

      C#

c1DataGrid1.AllowHorizontalSplit = false;

c1DataGrid1.AllowVerticalSplit = false;

Set the AllowHorizontalSplitSizing and AllowVerticalSplitSizing properties to False to prevent users from sizing horizontal and vertical splits. For example, use the following code to prevent users from sizing splits:

      Visual Basic

C1DataGrid1.AllowHorizontalSplitSizing = False

C1DataGrid1.AllowVerticalSplitSizing = False

      C#

c1DataGrid1.AllowHorizontalSplitSizing = false;

c1DataGrid1.AllowVerticalSplitSizing = false;


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.