Articles in this section
Category / Section

How to get Renderer of any cell in WinRT DataGrid?

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:

WPF

WRT

UWP

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied