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.
Hello,
I have an application that uses the SyncFusion GridControl (Not Bound Grid) that has many columns of financial data. When values that are too big to display in the set column width they are truncated. In many cases, it is next to impossible to know that the visual data is not complete. I have looked through many of the properties for the GridCOntrol and did not find anything that looks like it would help. I did see the example in the knowledege base about haow to display elipsis on a Bound Data Grid but I would rather show "#######" instead. Anybody have a clue on how to achieve this?
Thank you for your time and attention in advance,
Scott #s
ADAdministrator Syncfusion Team September 21, 2004 11:53 AM UTC
Scott,
I accomplished this by creating my own custom cell, overriding the draw method and measuring the text before calling DrawString. If the text does not fit, modify (with #''s) before calling DrawString. You can probably find a custom cell example in the Syncfusion examples.
To speed things up, you can store the modified text and reset this variable based on column width change events, for example. Good Luck.
Steve
ADAdministrator Syncfusion Team September 21, 2004 12:56 PM UTC
One event that works for any cell type (so you don''t have to derive a cell type) is the DrawCellDisplayText event.
From within that event you can call the static GridStaticCellRenderer.DrawText method and afterwards set e.Cancel = true to prevent the grid from calling GridStaticCellRenderer.DrawText again when the event returns.
Stefan
SNScott NumbersOctober 5, 2004 03:18 PM UTC
Thanks for the response. I used the Grid_DrawCell Event and it did the trick. This event was good because it provided easy access to the cell contents, the cell rectangle and a graphics object to do the measurement.
Brief Sample:
SizeF sz = e.Graphics.MeasureString(e.Style.CellValue.ToString(), mNumericFont);
if ((sz.Width + 2) > e.Bounds.Width) {
e.Style.CellValue = "################";
}
Thanks again.
>One event that works for any cell type (so you don''t have to derive a cell type) is the DrawCellDisplayText event.
>
>From within that event you can call the static GridStaticCellRenderer.DrawText method and afterwards set e.Cancel = true to prevent the grid from calling GridStaticCellRenderer.DrawText again when the event returns.
>
>Stefan