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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing Column Format

Thread ID:

Created:

Updated:

Platform:

Replies:

3262 Mar 11,2003 10:55 AM UTC Mar 11,2003 05:37 PM UTC Windows Forms 1
loading
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";
} 

CONFIRMATION

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.

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

;