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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:





45651 Jun 26,2006 01:49 PM Jun 26,2006 03:00 PM Windows Forms 2
Tags: GridControl
Clive Hill
Asked On June 26, 2006 01:49 PM

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.)

Administrator [Syncfusion]
Replied On June 26, 2006 02:33 PM

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

Clive Hill
Replied On June 26, 2006 03:00 PM

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 >


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.