Disabling Column and Row Resizing

By default end users can resize columns and rows in the grid at run time. For more information, see Resizing Columns and Rows. If you choose, however, you can disable the column and row resizing feature by setting the CanUserResizeColumns and CanUserResizeRows properties to False.

At Design Time

To disable column and row resizing, complete the following steps:

1.   Click the C1DataGrid control once to select it.

2.   Navigate to the Properties window and locate the CanUserResizeColumns property.

3.   Clear the check box next to the CanUserResizeColumns property.

4.   In the Properties window, locate the CanUserResizeRows property.

5.   Clear the check box next to the CanUserResizeRows property.

In XAML

For example to disable column and row resizing, add CanUserResizeColumns="False" CanUserResizeRows="False" to the < c1:C1DataGrid> tag so that it appears similar to the following:

<c1:C1DataGrid Name="c1datagrid1" Height="180" Width="250" CanUserResizeColumns="False" CanUserResizeRows="False"/>

In Code

For example, to disable column and row resizing, add the following code to your project:

      Visual Basic

      C#

What You've Accomplished

Run the application and observe that you can no longer resize columns or rows at run time by preforming a drag-and-drop operation. For more information about column reordering, see the Resizing Columns and Rows topic.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.