SoFunction
Updated on 2025-03-07

DevExpress implements a method to obtain a RepositoryItem based on row and column indexes

This article describes the method of DevExpress to obtain RepositoryItem based on row and column index. The specific method is as follows:

The main function codes are as follows:

/// <summary>
/// Get the RepositoryItem based on the row and column index/// </summary>
/// <param name="view">GridView</param>
/// <param name="rowIndex">Row Index</param>/// <param name="columnIndex">Column Index</param>/// &lt;returns&gt;RepositoryItem&lt;/returns&gt;
public static RepositoryItem GetRepositoryItem(this GridView view, int rowIndex, int columnIndex)
{
  GridViewInfo _viewInfo = () as GridViewInfo;
  GridDataRowInfo _viewRowInfo = _viewInfo.(rowIndex) as GridDataRowInfo;
  return _viewRowInfo.Cells[columnIndex].Editor;
}

Hope the code described in this article will be helpful to everyone!