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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

45651 Jun 26,2006 05:49 PM UTC Jun 26,2006 07:00 PM UTC WinForms 2
loading
Tags: GridControl
Clive Hill
Asked On June 26, 2006 05:49 PM UTC

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

Clive Hill
Replied On 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 >

CONFIRMATION

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.

Warning Icon 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.Close Icon

;