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 am trying to find a way to
dynamially change column formatting
in virtual grid when the user
rearranges columns using drag and drop.
I need to format dates, numbers, currency fields etc.
I could not find a good example,
but here is what I came up with:
vGrid.Model.ColStyles[i].Format= "d";
//or another format specifyer
However, it does not work and even when I read this property right after I set it I am getting "" (an empty string)
Anybody knows how to handle this?
Your help is appreciated
ADAdministrator Syncfusion Team February 14, 2005 09:58 PM UTC
In a virtual grid, you can set a column format using QueryCellInfo. Check for e.ColIndex equal to the column you want to set and check e.RowIndex == -1, and then set e.Style.Format.
IVIgor VolnovFebruary 15, 2005 12:43 AM UTC
Is not it better performance wise to
set formatting on the column
level once, rather than setting it for each
individual cell on the grid?
ADAdministrator Syncfusion Team February 15, 2005 01:58 AM UTC
There are no colstyles allocated in a true virtual grid. If you want to allocate the column styles, then you should not use QueryColCount, but instead just explicitly set grid.ColCount. This will allocate the storage required for the ColStyles and then you should be able to set them directly (provided your QueryCellStyleInfo code does not change the e.Style when e.RowIndex == -1 and e.ColIndex > 0).