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.

formatting numbers

Thread ID:

Created:

Updated:

Platform:

Replies:

13182 Apr 21,2004 10:35 PM Apr 22,2004 02:39 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 21, 2004 10:35 PM

I''m having a problem formatting decimals. I want the right-most decimals to not be zero-suppressed. I want 1.50 to print with the zero at the end. The number of decimal positions can vary so I need to control this at run-time. Any suggestions? Also, I''m having problems right-justifying text in columns at runtime. I have the textalign.right turned ''on'' for the columnstyle. What else do I need to set to make it work? Also, I want text to overlap blank cells next to it. The colstyle has word-wrap turned ''off'', trimming set to ''none'' and floatcell turned ''on'', what else do I need to set to make it work. THANKS!

Administrator [Syncfusion]
Replied On April 22, 2004 02:39 AM

To format numbers with required use a formatting string such as "#.00" to show required decimal places. One other point is that you alos need to set the CellValueType. You can set these values at runtime //grid is a GridControl this.grid[2,2].Format = "#.00"; this.grid[2,2].CellValueType = typeof(double); //grid is a GridDataBoundGrid this.grid.Binder.InternalColumns[2].StyleInfo.Format = "#.00"; this.grid.Binder.InternalColumns[2].StyleInfo.CellValueType = typeof(double); If you have added GridBoundColumns, then use those instead of the Binde.InternalColumns member. TextAligned is used to place text in relation to buttons. To set the cell''s horizontal alignment, use the HorizontalAlignment property instead. Two things on the float cells, you also need to set the grid''s FloatCellsMode property, maybe this.gridControl1.FloatCellsMode = Syncfusion.Windows.Forms.Grid.GridFloatCellsMode.OnDemandCalculation; and the adjacent cell must be empty. You cannot float over an occupied cell.

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.

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.

;