Class GridIndexResolver
Represents an extension class that provides an set of index resolver helper methods in SfDataGrid.
Inheritance
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public static class GridIndexResolver : Object
Methods
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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. |
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 | |
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. |
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. |
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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. |
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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 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.Grid;
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.Grid;
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.Grid;
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.Grid;
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.Grid;
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 UnBoundRow. |
Examples
using Syncfusion.UI.Xaml.Grid;
int rowIndex = dataGrid.ResolveUnboundRowToRowIndex(unboundRow);