Helpers

IndexResolver

SfDataGrid has GridIndexResolver static class present in Syncfusion.UI.Xaml.Grid namespace, that has some extension methods used to Resolves from row or column index to record or visible column index and vice versa.

Example: You can find the record index from row index using ResolveToRecordIndex method.

ProtoType Description
ResolveToRecordIndex(int rowIndex) Resolves Record index from the RowIndex. When RowIndex does not find any records it returns -1. RecordIndex denotes the index of Record in SfDataGrid.View.Records
ResolveToRowIndex(int recordIndex) Resolves RowIndex from the record index associated with SfDataGrid.View.Records.If record index less than 0 it returns the -1.
ResolveToRowIndex(object recordItem) Resolves row index from the record associated with SfDataGrid.View.Records.If the given record not available in the collection it returns -1.
ResolveStartIndexOfGroup(Group group) Resolves the start index of group in SfDataGrid associated with SfDataGrid.View.Groups.If there is no group in SfDataGrid it returns -1.
ResolveToTableSummaryIndex(int rowIndex) Resolves TableSummaryIndex associated with SfDataGrid.View.Records.TableSummaries. If the row is not a TableSummaryRow returns -1.
ResolveToGridVisibleColumnIndex(int visibleColumnIndex) Resolves the GridColumn index from the visible column index. It excludes the RowHeader and IndentColumn.
ResolveStartIndexBasedOnPosition() Resolves the start index based on position. It includes the stacked header also. By default it returns 0.
ResolveToScrollColumnIndex(int gridColumnIndex) Resolves column index from the Grid column index associated with SfDataGrid.Columns.It includes the IndentColumn and RowHeader also.
ResolveToStartColumnIndex() Returns start column index of the VisibleColumn.
GetGridDetailsViewRowIndex(DetailsViewDataGrid detailsViewDataGrid) Returns the RowIndex of DetailsViewGrid. You can pass the DetailsViewDataGrid as argument. If the DetailsView does not found it returns the -1.
GetGridDetailsViewRecord(DetailsViewDataGrid detailsViewDataGrid) Returns the DetailsView record. You can pass the DetailsViewDataGrid.If there is no item it returns null value.
GetTableSummaryCount(TableSummaryRowPosition position) Returns the TableSummary count from TableSummaryRowPosition.Position.
GetHeaderIndex() Returns the header row index.
IsInDetailsViewIndex(int rowIndex) Whether the given row index is DetailsView index or not.
IsAddNewIndex(int rowIndex) Whether the given row index is AddNewRow index or not.

Dispose

The method is associated with relinquishes memory and clears all references associated with SfDataGrid. When you call this method, it releases all the reference for SfDataGrid. So the memory it is occupying by the SfDataGrid can be reclaimed. You have to call SfDataGrid.Dispose method to release the memory.