Class GridIndexResolver
Represents an extension class that provides an set of index resolver helper methods in SfDataGrid.
Inheritance
Namespace: Syncfusion.UI.Xaml.DataGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public static class GridIndexResolver : ObjectMethods
GetAddNewRowIndex(SfDataGrid)
Gets the corresponding row index of the AddNewRowControl.
Declaration
public static int GetAddNewRowIndex(this SfDataGrid dataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns an index of the AddNewRowControl. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int addNewRowIndex = dataGrid.GetAddNewRowIndex();GetFilterRowIndex(SfDataGrid)
Gets the corresponding row index of the FilterRow.
Declaration
public static int GetFilterRowIndex(this SfDataGrid dataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns an index of a FilterRow. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int filterRowIndex = dataGrid.GetFilterRowIndex();GetGridDetailsViewRecord(SfDataGrid, DetailsViewDataGrid)
Gets the record associated with the specified DetailsViewDataGrid.
Declaration
public static object GetGridDetailsViewRecord(this SfDataGrid dataGrid, DetailsViewDataGrid detailsViewDataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| DetailsViewDataGrid | detailsViewDataGrid | Specifies the DetailsViewDataGrid to get its corresponding record entry. | 
Returns
| Type | Description | 
|---|---|
| System.Object | The record associated with the specified DetailsViewDataGrid; returns null, if the DetailsViewDataGrid is null. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
object record = dataGrid.GetGridDetailsViewRecord(DetailsViewDataGrid detailsViewDataGrid);GetGridDetailsViewRowIndex(SfDataGrid, DetailsViewDataGrid)
Gets the row index of the specified DetailsViewDataGrid.
Declaration
public static int GetGridDetailsViewRowIndex(this SfDataGrid dataGrid, DetailsViewDataGrid detailsViewDataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| DetailsViewDataGrid | detailsViewDataGrid | Specifies the DetailsViewDataGrid to get its corresponding row index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the row index of the corresponding DetailsViewDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int detailsViewRowIndex = dataGrid.GetGridDetailsViewRowIndex(DetailsViewDataGrid detailsViewDataGrid);GetHeaderIndex(SfDataGrid)
Gets the corresponding row index of HeaderRowControl in SfDataGrid.
Declaration
public static int GetHeaderIndex(this SfDataGrid grid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | grid | Specifies the corresponding SfDataGrid. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns an index of the HeaderRowControl. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int headerIndex = dataGrid.GetHeaderIndex();GetTableSummaryCount(SfDataGrid, TableSummaryRowPosition)
Gets the total number of table summary rows in SfDataGrid according to the specified TableSummaryRowPosition.
Declaration
public static int GetTableSummaryCount(this SfDataGrid grid, TableSummaryRowPosition position)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | grid | Specifies the corresponding SfDataGrid. | 
| TableSummaryRowPosition | position | Specifies the position of table summary row to get its count. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the number of table summary rows in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int tableSummaryRowCount = dataGrid.GetTableSummaryCount(TableSummaryRowPosition.Bottom);GetUnboundRow(SfDataGrid, Int32)
Gets the UnboundRow for the specified row index.
Declaration
public static GridUnboundRow GetUnboundRow(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | The SfDataGrid. | 
| System.Int32 | rowIndex | The row index to get the UnboundRow. | 
Returns
| Type | Description | 
|---|---|
| GridUnboundRow | Returns the corresponding GridUnboundRow for the specified row index. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
GridUnboundRow unboundRow = dataGrid.GetUnboundRow(rowIndex);GetUnboundRowsCount(SfDataGrid, UnboundRowsPosition)
Gets the total number of UnboundRows in SfDataGrid according to the specified UnboundRowsPosition.
Declaration
public static int GetUnboundRowsCount(this SfDataGrid dataGrid, UnboundRowsPosition position)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | The SfDataGrid. | 
| UnboundRowsPosition | position | Specifies the position of unbound row to get its count. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the total number of UnboundRows in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int unboundRowsCount = dataGrid.GetUnboundRowsCount(UnboundRowsPosition.Bottom);GetUnboundRowsCount(SfDataGrid, UnboundRowsPosition, Boolean)
Gets the total number of UnboundRows in SfDataGrid according to the specified UnboundRowsPosition and summary location.
Declaration
public static int GetUnboundRowsCount(this SfDataGrid dataGrid, UnboundRowsPosition position, bool belowSummary)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | The SfDataGrid. | 
| UnboundRowsPosition | position | Specifies the position of UnboundRows to get its count. | 
| System.Boolean | belowSummary | Specifies whether the UnboundRow is placed above or below summary row. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the total number of UnboundRows in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int unboundRowsCount = dataGrid.GetUnboundRowsCount(UnboundRowsPosition.Bottom,true);IsAddNewIndex(SfDataGrid, Int32)
Determines whether the specified row index is associated with AddNewRowControl.
Declaration
public static bool IsAddNewIndex(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding rowIndex to determine the AddNewRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the specified row index is AddNewRowControl; otherwise , false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 1;
bool isAddNewIndex = dataGrid.IsAddNewIndex(rowIndex);IsFilterRowIndex(SfDataGrid, Int32)
Determines whether the specified row index is associated with FilterRow.
Declaration
public static bool IsFilterRowIndex(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding rowIndex to determine the FilterRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the specified row index is FilterRow; otherwise , false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 1;
bool isFilterRowIndex = dataGrid.IsFilterRowIndex(rowIndex);IsHeaderTableSummaryRow(SfDataGrid, Int32)
Determines whether the TableSummaryRow is at the top position of SfDataGrid for the specified row index.
Declaration
public static bool IsHeaderTableSummaryRow(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding row index to determine the position of TableSummaryRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the TableSummaryRow placed at the top position of SfDataGrid ; otherwise false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 1;
bool isHeaderTableSummaryRow = dataGrid.IsHeaderTableSummaryRow(rowIndex);IsInDetailsViewIndex(SfDataGrid, Int32)
Determines whether the specified row index is associated with DetailsViewDataRow.
Declaration
public static bool IsInDetailsViewIndex(this SfDataGrid dataGrid, int rowIdx)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIdx | Specifies the corresponding row index to determine whether the row index is in DetailsViewDataRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the specified row index is associated with DetailsViewDataRow; otherwise, false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
bool isInDetailsViewIndex = dataGrid.IsInDetailsViewIndex(rowIndex);IsTableSummaryIndex(SfDataGrid, Int32)
Determines whether the specified row index is associated with TableSummaryRow.
Declaration
public static bool IsTableSummaryIndex(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding rowIndex to determine the TableSummaryRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the specified row index is TableSummaryRow; otherwise, false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 1;
bool isTableSummaryIndex = dataGrid.IsTableSummaryIndex(rowIndex);IsUnboundRow(SfDataGrid, Int32)
Determines whether the specified row index is associated with any UnboundRow's.
Declaration
public static bool IsUnboundRow(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | The SfDataGrid. | 
| System.Int32 | rowIndex | The corresponding rowIndex to determine the UnboundRow. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | Returns true if the specified row index is UnboundRow; otherwise, false. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
bool isUnboundRow = dataGrid.IsUnboundRow(rowIndex);ResolveStartIndexBasedOnPosition(SfDataGrid)
Resolves the start index of row based on position in SfDataGrid.
Declaration
public static int ResolveStartIndexBasedOnPosition(this SfDataGrid dataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns start index of row based on position in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int startIndex = dataGrid.ResolveStartIndexBasedOnPosition();ResolveStartIndexOfGroup(SfDataGrid, Group)
Resolves the start index of the specified Group.
Declaration
public static int ResolveStartIndexOfGroup(this SfDataGrid dataGrid, Group group)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| Group | group | Specifies the group to get its corresponding start index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | The start index of the specified Group; returns -1; if the column is not grouped in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int index = dataGrid.ResolveToRowIndex(Group group);ResolveToGridVisibleColumnIndex(SfDataGrid, Int32)
Resolves the GridColumn index for the specified visible column index in SfDataGrid.
Declaration
public static int ResolveToGridVisibleColumnIndex(this SfDataGrid dataGrid, int visibleColumnIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | visibleColumnIndex | Specifies the corresponding visible column index to get the grid column index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the GridColumn index for the specified visible column index. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int visibleColumnIndex = 2;
int gridColumnIndex = dataGrid.ResolveToGridVisibleColumnIndex(visibleColumnIndex);ResolveToGroupRecordIndexForDetailsView(SfDataGrid, Int32)
Resolves the group record index for the specified row index when the SfDataGrid has Details View.
Declaration
public static int ResolveToGroupRecordIndexForDetailsView(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding row index to get group index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the group record index of the specified row index when the SfDataGrid has Details View. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
int groupIndex = dataGrid.ResolveToGroupRecordIndexForDetailsView(rowIndex);ResolveToRecordIndex(SfDataGrid, Int32)
Resolves the record index corresponding to the specified row index in SfDataGrid.
Declaration
public static int ResolveToRecordIndex(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the row index to get its corresponding record index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the record index of the specified row index in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
int recordIndex = dataGrid.ResolveToRecordIndex(rowIndex);ResolveToRowIndex(SfDataGrid, NodeEntry)
Resolves the row index corresponding to the specified NodeEntry.
Declaration
public static int ResolveToRowIndex(this SfDataGrid DataGrid, NodeEntry nodeEntry)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | DataGrid | Specifies the corresponding SfDataGrid. | 
| NodeEntry | nodeEntry | Specifies the node entry to get its corresponding row index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the row index of the specified NodeEntry. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = dataGrid.ResolveToRowIndex(NodeEntry nodeEntry);ResolveToRowIndex(SfDataGrid, Int32)
Resolves the row index corresponding to the specified record index in SfDataGrid.
Declaration
public static int ResolveToRowIndex(this SfDataGrid dataGrid, int recordIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Speicifes the corresponding SfDataGrid. | 
| System.Int32 | recordIndex | Specifies the record index to get its corresponding row index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the row index of the specified record index in SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int recordIndex = 2;
int rowIndex = dataGrid.ResolveToRowIndex(recordIndex);ResolveToRowIndex(SfDataGrid, Object)
Resolves the row index corresponding to the specified record.
Declaration
public static int ResolveToRowIndex(this SfDataGrid dataGrid, object recordItem)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Object | recordItem | Specifies the record to get its corresponding row index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the row index of the specified record. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = dataGrid.ResolveToRowIndex(object rowData);ResolveToScrollColumnIndex(SfDataGrid, Int32)
Resolves the scroll column index for the specified column index in SfDataGrid.
Declaration
public static int ResolveToScrollColumnIndex(this SfDataGrid dataGrid, int gridColumnIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | gridColumnIndex | Specifies the corresponding column index to get the scroll column index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the scroll column index for the specified column index. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int columnIndex = 2;
int scrollColumnIndex = dataGrid.ResolveToScrollColumnIndex(columnIndex);ResolveToStartColumnIndex(SfDataGrid)
Resolves the start column index of the SfDataGrid.
Declaration
public static int ResolveToStartColumnIndex(this SfDataGrid dataGrid)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the start column index of the SfDataGrid. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int startColumnIndex = dataGrid.ResolveToStartColumnIndex();ResolveToTableSummaryIndex(SfDataGrid, Int32)
Resolves the table summary index corresponding to the specified row index in SfDataGrid.
Declaration
public static int ResolveToTableSummaryIndex(this SfDataGrid dataGrid, int rowIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | dataGrid | Specifies the corresponding SfDataGrid. | 
| System.Int32 | rowIndex | Specifies the corresponding row index to get its table summary index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | The table summary index corresponding to the specified row index ; returns -1 , if the SfDataGrid is null. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = 2;
int tableSummayIndex = dataGrid.ResolveToTableSummaryIndex(rowIndex);ResolveUnboundRowToRowIndex(SfDataGrid, GridUnboundRow)
Resolves row index for the specified GridUnboundRow.
Declaration
public static int ResolveUnboundRowToRowIndex(this SfDataGrid DataGrid, GridUnboundRow unboundRow)Parameters
| Type | Name | Description | 
|---|---|---|
| SfDataGrid | DataGrid | Specifies the corresponding SfDataGrid. | 
| GridUnboundRow | unboundRow | Specifies the UnboundRow to get its corresponding row index. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Returns the row index of the specified GridUnboundRow. | 
Examples
using Syncfusion.UI.Xaml.DataGrid;
int rowIndex = dataGrid.ResolveUnboundRowToRowIndex(GridUnBoundRow unboundRow);