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.
I have a custom CellModel and CellRenderer.
The CellRenderer draws a special "graph" based on values from 3 columns in the each row.
I pass the names of the columns into the constructor of the Model, which passes it to the constructor of the renderer.
During the renderer''s Draw method, I cannot correctly get the record / data I need.
I cannot find a GetRecord method of anything exposed to the Renderer, so I''m trying to use Grid.Model[rowIndex, x], where X is defined by:
int x = grid.Model.NameToColIndex(columnName)
This works, as long as the Visible Columns Collection hasn''t changed. However, if it has, then the data returned by this call is for the wrong columns.
Bottom Line:
How do I get to the correct record data during the renderer''s Draw method?
There is no GetRecord() method available to the GridTableControl class that is returned by the base Grid class in the renderer.
There is likewise, no GetRecord() method in the Grid.Model (of type GridTableModel)
HOW DO I GET THE RECORD?
Going Nuts.
Eric
Updated Question:
I finally figured out that I needed to cast the base Grid object to GridTableControl.
NOW...
How do I get the appropriate Record Row Index from the Grid Row index passed into the Draw method of the CellRenderer Class?
The following DO NO return the correct row when the grid is SORTED:
gtc.Table.Records[rowIndex]
gtc.Table.Records(gtc.GetClientRow(rowIndex))
BOTTOM LINE QUESTION:
Using GridTableControl object, and the (visible) rowIndex provided by the Draw Method of the GridCellRenderer, how do I get the correct Record?
EREric RobishawApril 28, 2006 09:56 PM UTC
OK... after much digging:
//CAST the Grid object to GridTableControl
GridTableControl gtc = (GridTableControl) Grid;
//Get the underliying elemement
Element el = gtc.Table.DisplayElements[rowIndex];
//Get the element Record
Record record = el.ParentRecord;
>Updated Question:
>
>I finally figured out that I needed to cast the base Grid object to GridTableControl.
>
>NOW...
>How do I get the appropriate Record Row Index from the Grid Row index passed into the Draw method of the CellRenderer Class?
>
>The following DO NO return the correct row when the grid is SORTED:
>
>gtc.Table.Records[rowIndex]
>gtc.Table.Records(gtc.GetClientRow(rowIndex))
>
>BOTTOM LINE QUESTION:
>Using GridTableControl object, and the (visible) rowIndex provided by the Draw Method of the GridCellRenderer, how do I get the correct Record?
>
>