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

Changing Column Format

Thread ID:





3262 Mar 11,2003 10:55 AM UTC Mar 11,2003 05:37 PM UTC WinForms 1
Tags: GridControl
Jose Luis Melo
Asked On March 11, 2003 10:55 AM UTC

Hi, I have a table in a dataset, that was filled with a datadapter, and then bounded to a GridListcontrol. I wish to format one specific column in the grid as currency (the data type in the table is double). I tried to do: grdLst.Grid.ColStyles["Value"].Format= "C"; but this doesn't work. How do I do this ? Thank you,

Administrator [Syncfusion]
Replied On March 11, 2003 05:37 PM UTC

The Grid in a GridListControl is a virtual grid. To set any of the styles, you will need to handle the PrepareViewStyleInfo event and set the style there.
 grdLst.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(PVSI);


private void PVSI(object sender, GridPrepareViewStyleInfoEventArgs e)
    if( e.ColIndex == 2 && e.RowIndex > 0)
        e.Style.Format = "C";


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