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

GridViewRowInfo

GridViewRowInfo class is the logical representation of a single row. Some of the significant properties include:

  • IsEditable: The row can be edited.

  • IsExpanded: This property indicates if the row has been expanded when the row is a grouping header row or when displaying hierarchy.

  • IsPinned: Can be pinned to the top of the grid so the row will always be visible, even when scrolling.

  • IsSelected: If set to true the row is selected.

  • Height: The height of the row in pixels.

  • IsCurrent: If set to true the row is selected.

  • AllowResize: If true, the height of the row can be resized. If False the splitter mouse cursor does not display and the row is prevented from being resized.

  • IsVisible: Determines whether the row is visible. Note this is NOT related to scrolling but visible in general.

GridViewRowInfo also has an EnsureVisible method that scrolls a row into view.

The example below demonstrates the behavior of several of these properties:

WinForms RadGridView Customized Row

Using GridViewRowInfo

GridViewRowInfo lastRow = radGridView1.Rows[radGridView1.Rows.Count - 1];
lastRow.EnsureVisible();
lastRow.IsSelected = true;
lastRow.Height = 100;
lastRow.AllowResize = false;

Dim lastRow As GridViewRowInfo = RadGridView1.Rows(RadGridView1.Rows.Count - 1)
lastRow.EnsureVisible()
lastRow.IsSelected = True
lastRow.Height = 100
lastRow.AllowResize = False

Difference between GridViewInfo.Rows and GridViewTemplate.Rows

One GridViewTemplate corresponds to one DataSource. As its name speaks, it is a template and it defines the structure of the data presented - the number, order, header text and other properties of the columns. In addition it has properties for user interaction - AllowAddNewRow, ShowColumnHeaders, etc. On the other side, you may have several GridViewInfo's(views) for one DataSource. In a RadGridView displaying flat data, there is one GridViewTemplate and one GridViewInfo for one DataSource. Therefore, you will find that some of their properties will return one and the same values. In order to understand the actual difference, let's analyze the case of hierarchical grid with 2 levels of hierarchy - one parent and one child levels. Since there are two DataSources in this case, there are two GridViewTemplates - one per level. These GridViewTemplates govern the data structure properties. However, you may have several GridViewInfos for one GridViewTemplate - if you have three rows of the MasterTemplate expanded, you will have three GridViewInfos for the child GridViewTemplate.

GridViewInfo.Rows are a subset of GridVIewTemplate.Rows. The subset is created dynamically so it is slower operation.

See Also

In this article