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

General Cell Format

Thread ID:

Created:

Updated:

Platform:

Replies:

6432 Aug 12,2003 11:09 PM UTC May 23,2004 04:22 PM UTC Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 12, 2003 11:09 PM UTC

Is there a way to format a cell like Excel's "General" format so that numbers are automatically right aligned and strings are left aligned?

Administrator [Syncfusion]
Replied On August 13, 2003 06:37 AM UTC

> Is there a way to format a cell like Excel's "General" format so that numbers are automatically right aligned and strings are left aligned? > No. But you could handle PrepareViewStyleInfo, and set e.Style.HorizontalAlignment dynamically. If you have explicitly set the CellValueType for your numeric cells, you could test e.Style.CellValueType to determine how to set the alignment. If you have not set the CellValueType, you could try parsing e.Style.Text to see if it parses as a number to test what is in the cell.

Jeff
Replied On May 23, 2004 02:20 PM UTC

I need text to align right for financial numbers which seems to be a very common occurence for grids? Um can someone please create a sample for this for us not so advanced programmers? plz >> Is there a way to format a cell like Excel''s "General" format so that numbers are automatically right aligned and strings are left aligned? >> > >No. > >But you could handle PrepareViewStyleInfo, and set e.Style.HorizontalAlignment dynamically. If you have explicitly set the CellValueType for your numeric cells, you could test e.Style.CellValueType to determine how to set the alignment. If you have not set the CellValueType, you could try parsing e.Style.Text to see if it parses as a number to test what is in the cell.

Administrator [Syncfusion]
Replied On May 23, 2004 04:22 PM UTC

Are you using one of our grids?

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

;