New to Telerik UI for WinForms? Download free 30-day trial

Reordering System Rows

RadGridView provides out of the box API for reordering its system rows: GridFilterRowElement, GridSearchRowElement, GridNewRowElement. The figures below illustrate RadGridView before and after the reordering operation.

Figure 1: Default Order

WinForms RadGridView Default Order

Figure 2: Reordered Rows

WinForms RadGridView Reordered Rows

In order to perform system rows reordering, you can use the RadGridView.MasterView.SystemRows.Move method. Required parameters are two indices according to which the row will be reordered, the first one being the old index and second one being the new index. The default order (starting from the top) is:

  • GridViewTableHeaderRowInfo: 0

  • GridViewNewRowInfo: 1

  • GridViewFilteringRowInfo: 2

  • GridViewSearchRowInfo: 3

Reordering System Rows

this.radGridView1.MasterView.SystemRows.Move(1, 2);
this.radGridView1.MasterView.SystemRows.Move(2, 3);

Me.RadGridView1.MasterView.SystemRows.Move(1, 2)
Me.RadGridView1.MasterView.SystemRows.Move(2, 3)

The layout needs to be invalidated and updated in order to reflect the changes.

See Also

In this article