How to get the alpha label name of the column and rows in WinForms GridControl?
Row and column name
To get the alpha label name and the Numeric label of a column/row, GridRangeInfo.GetAlphaLabel and GridRangeInfo.GetNumericLabel methods can be used.
// Event Handler
this.grid.CellClick += new GridCellClickEventHandler(grid_CellClick);
private void grid_CellClick(object sender, GridCellClickEventArgs e)
{
// Get the alpha label name of the column and numeric label of the row
string colName = GridRangeInfo.GetAlphaLabel(e.ColIndex);
string rowName = GridRangeInfo.GetNumericLabel(e.RowIndex);
MessageBox.Show($"ColumnName: {colName} and RowName: {rowName}");
}'Event Handler
AddHandler Me.grid.CellClick, AddressOf grid_CellClick
Private Sub grid_CellClick(ByVal sender As Object, ByVal e As GridCellClickEventArgs)
'Used to get the alpha label name of the column and rows
MessageBox.Show("ColumnName: " & GridRangeInfo.GetAlphaLabel(e.ColIndex) & " and RowName: " & GridRangeInfo.GetNumericLabel(e.RowIndex))
End SubNote:
In this sample, we have displayed the alpha label name and the numeric label name in the grid cell on click.
Screenshot
