ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Controlling Grid Interaction > Preventing Rows from Being Deleted

Preventing Rows from Being Deleted

You can prevent users from deleting rows at run time by using the AllowDelete property. By default the AllowDelete property is set to True and end-users can delete rows from the grid with the CTRL-D key combination. By setting the AllowDelete property to False you can prevent users from deleting rows in the grid.

In XAML

Prevent users from deleting grid rows at run time by adding AllowDelete="False" to the <c1grid:C1DataGrid> tag so that it looks similar to the following:

<c1grid:C1DataGrid Name="C1DataGrid1" AllowDelete="False"/>

In Code

Prevent users from deleting grid rows at run time by adding the following code to your project:

      Visual Basic

C1DataGrid1.AllowDelete = False

      C#

c1DataGrid1.AllowDelete = false;


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