DataGridViewSortCompareEventArgs Class

Provides data for the SortCompare event of the DataGridView control.

You can use this event to sort rows using the cell values in one column or in multiple columns. Use the CellValue1 and CellValue2 properties to compare cell values in the column specified in the Column property. Use the RowIndex1 and RowIndex2 properties to access values in other columns through the DataGridViewRowCollection.

Namespace: elsystem.windows.forms

Properties

  Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property CellValue1 object Gets the value of the first cell to compare.
Public property CellValue2 object Gets the value of the second cell to compare.
Public property Column object Gets the column being sorted.
Public property RowIndex1 int Gets the index of the row containing the first cell to compare.
Public property RowIndex2 int Gets the index of the row containing the second cell to compare.
Public property SortResult int Gets or sets a value indicating the order in which the compared cells will be sorted.
Methods
  Name Description
Public property Create(column,cellValue1,CellValue2,rowIndex1,rowIndex2) Initializes a new instance of the class using the specified parameters