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:02 Jan 2022 11:39
It has been a few months since this was opened, and there are ways to do the desired task discussed in this thread that my colleague Svetoslav provided. So, I am marking this one as "Completed" to keep the portal tidy as it does not seem to relate to a missing feature in the components. If there is new pertinent information or an actual situation, please provide the relevant information and this could be reopened.
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?