Currently I have the below code that works when the "Notes" Column is the last column and is on screen.
If grid overflows and needs a scroll bar the CellLoaded method gets called indefinitely until user scrolls to make the "Notes" Column show on the screen. And needs to stay on screen while scrolling up/down to keep expected functionality.
private void radGridView_CellLoaded(object sender, CellEventArgs e)
{
GridViewCellBase cellItem = e.Cell;
// Only run once per row, after all cells are loaded [Notes is last loaded column]
if (cellItem.Column.UniqueName == "Notes")
{
GridViewRowItem rowItem = cellItem.ParentRow;
if (rowItem.Item != null && rowItem.Item is DataRowView)
{
_viewModel.ToggleHighlightingCells_BasedOn_CellSpecificHighlighting_Column(((DataRowView)rowItem.Item).Row, rowItem.Cells);
}
}
}
I have tried to use RowLoaded (see below), but the styling achieved is not applied correctly
private void radGridView_RowLoaded(object sender, RowLoadedEventArgs e)
{
if (e.Row is GridViewRowItem rowItem && rowItem.Item is DataRowView dataRowView)
{
_viewModel.ToggleHighlightingCells_BasedOn_CellSpecificHighlighting_Column(dataRowView.Row, rowItem.Cells);
}
}
Any thoughts of what I can do to make the RowLoaded method work like the CellLoaded?
Is Loaded methods ran first is there a trigger that happens after Load?
I am needing the data in the row to be populated and then the styling applied after, based on the data loaded in the row