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.
In GridTextBoxCellRenderer::OnDraw, if I set
style.ApplyText("Hello World!");
Will the displaystring in the grid from there on be "Hello World!", irrespective of what the cellvalue or cellvalue''s ToString is(which is what I want)?
ADAdministrator Syncfusion Team December 2, 2005 12:54 AM UTC
If you just want to control the text that is displayed in cells, but not affect anything else (like the cell value, etc.), the try handling the grid.DrawCellDisplayText event. There set e.DisplayText to the text you want to see in the cell pointed to by e.Style.CellIdentity.RowIndex and e.Style.CellIdentity.ColIndex.
ADAdministrator Syncfusion Team December 2, 2005 11:31 PM UTC
Having lot of problems with grid_DrawCellDisplayText.
As you pointed out I am using e.Style.CellIdentity.RowIndex and e.Style.CellIdentity.ColIndex to set the DisplayText.
However, whereas in the grid my Column = 4 is using a renderer say "MyRenderer", however in grid_DrawCellDisplayText, column 4 is not "MyRenderer" instead it is something else!!!
in grid_DrawCellDisplayText, i have :
if(this.GetType() == typeof(MyRenderer))
{
Debug.WriteLine(e.Style.CellIdentity.ColIndex);
}
The colindex being printed out is 12 instead of 4
What gives?
ADAdministrator Syncfusion Team December 3, 2005 01:03 AM UTC
OK i used Model_QueryCellFormattedText instead and it seems to be working fine.
PLEASE LET ME KNOW IF YOU FORESEE ANY PROBLEMS WITH THIS EVENT.
ADAdministrator Syncfusion Team December 3, 2005 01:38 AM UTC
>>if(this.GetType() == typeof(MyRenderer))
DrawCellDisplaytext is raised for every cell. So, since this code is in your renderer class, it will always be true as the ''this'' object is your renderer. It does not vary each time the DrawCellDisplaytext is raised. So, instead of testing this.GetType(), you might try:
if(grid.GetCellRenderer(e.Style.CellIdentity.RowIndex, e.Style.CellIdentity.ColIndex) is MyRenderer)