We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Accessing Other Fields in a Custom Cell Renderer

I''ve implemented some custom cell renderers. They need to be able to format the value of a cell according to the value of another cell in the same row of the grid. I''m using a GridDataBoundGrid. Is there a way of accessing the values of other columns in the same row? This is in the OnDraw method, all I have is a GridStyleInfo object and a rowIndex. I tried looking at GridStyleInfo.DataSource but it is not set to anything. Thanks, Ben.

2 Replies

AD Administrator Syncfusion Team October 11, 2004 11:26 AM

GridStyleInfo.DataSource is the datasourcde for things like a ComboBox in the cell or a GridListControl in the cell. It is not the DataSource for the grid. If you want to access the datasource for the grid, then you will have to get a reference to the DridDataBoundGrid. You can try casting the renderer.Grid member to a GridDataBoundGrid and then accessing its DataSource member.


AD Administrator Syncfusion Team October 12, 2004 07:17 AM

I''ve done as you suggest and passed in references to the CurrencyManager and the grid and got the behaviour I want. Thanks, Ben.

Loader.
Live Chat Icon For mobile
Up arrow icon