The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.)
ADAdministrator 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
CHClive HillJune 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
>