Category / Section
How to get Renderer of any cell in SfDataGrid?
1 min read
In SfDataGrid, you can get the Renderer of current cell by using the SfDataGrid.SelectionController.CurrentCellManager.CurrentCell.Renderer.
In another way, you can use CurrentCellActivated event to get the renderer of current cell.
C#
this.sfdatagrid.CurrentCellActivated += sfdatagrid_CurrentCellActivated; void sfdatagrid_CurrentCellActivated(object sender, CurrentCellActivatedEventArgs args) { var dataRow = sfdatagrid.GetRowGenerator().Items.FirstOrDefault(row => row.RowIndex == args.CurrentRowColumnIndex.RowIndex); var dataColumn = dataRow.VisibleColumns.FirstOrDefault(column => column.ColumnIndex == args.CurrentRowColumnIndex.ColumnIndex); var renderer = dataColumn.Renderer; }
Refer below documentation link to know more about renderes,
https://help.syncfusion.com/wpf/datagrid/column-types#customize-column-renderer
Sample Links: