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

GridGroupingControl - Getting value of cell on same record as a known cell

Hi, I am using QueryCellStyleInfo to set some properties of cell grids, such as background color. I want to set the background color of the cell, depending on the value of a cell in a different column of the grid, but on the same record. I can get the rowIndex of this cell by doing: int rowIndex = e.TableCellIdentity.RowIndex; I can then get the colIndex by doing: DataTable table = ggc.DataSource as DataTable; DataColumn col = table.Columns["Tenor"]; int colOrdinal = col.Ordinal; I can then get cellValue by doing: object cellValue = e.TableCellIdentity.Data[rowIndex, colOrdinal].CellValue; This, however, gives an empty string. Before going down this way any further, is there a more appropriate way of getting the other call''s value on the same row, as the above way seems pretty inefficient. (I''m still trying to get access to the available samples, which in future will hopefully answer these type of questions.)

2 Replies

AD Administrator Syncfusion Team June 26, 2006 06:33 PM UTC

Hi Vito, Colud you try this code to get the cellvalue in a grid. Here is a code snippet. object cellValue = e.TableCellIdentity.DisplayElement.ParentRecord.GetValue("Tenor"); Let me know if this helps. Best Regards, Haneef


CH Clive Hill June 26, 2006 07:00 PM UTC

Thanks Haneef, that''s worked! >Hi Vito, > >Colud you try this code to get the cellvalue in a grid. Here is a code snippet. > >object cellValue = e.TableCellIdentity.DisplayElement.ParentRecord.GetValue("Tenor"); > >Let me know if this helps. >Best Regards, >Haneef >

Loader.
Live Chat Icon For mobile
Up arrow icon