Include contextual information in GridCellRenderEventArgs, GridRowRenderEventArgs
Include row and column index & Field info in GridCellRenderEventArgs & row index in GridRowRenderEventArgs so that context can be used to look up ancillary information.
Posted on:25 Jun 2021 12:09
The OnCellRender and OnRowRender events provide an object (Item) that you can cast to your model class to get the current item through the event arguments. You can also use a lambda expression to provide the event handler with the name of the current column (for reference see the second example in the OnCellRender article) for the OnCellRender event.
When you are using the OnRowRender event you get access to the entire row through the Item object.
We have a KB article that showcases how to get the row index. You can use the approach from the knowledge base article and extend it to send the row index to the respective event handler.
That being said, could you give us a little bit more feedback on the need for the Field and column/row index in the event arguments for the OnRow/CellRender events?