We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Formatting columns in virtual grid

Thread ID:





24934 Feb 14,2005 09:38 PM UTC Feb 15,2005 01:58 AM UTC WinForms 3
Tags: GridControl
Igor Volnov
Asked On February 14, 2005 09:38 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Igor Volnov
Replied On February 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?

Administrator [Syncfusion]
Replied On 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).


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon