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.

"#" format and 0 in virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

35225 Sep 26,2005 07:30 PM Sep 27,2005 05:29 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 26, 2005 07:30 PM

Hi! I am using a virtual grid. One of the cell has e.style.Format = "#". When I put in the value of 0 through code in the cell, it becomes a blank cell. This also happens if you modify the sample grid included with Essential Studio. I am attaching the solution file that should show this. After running the sample, you want to look at cell A4. The cell value is 0.0 and the format is #, but the cell is blank. Thanks for any help! TextFormatVB_30.zip

Administrator [Syncfusion]
Replied On September 27, 2005 07:47 AM

Hi Raymond, Please refer this link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp ( # - Note that this specifier never displays the ''0'' character if it is not a significant digit, even if ''0'' is the only digit in the string.) You could set e.Style.Format=''0'' or try handling the QueryCellFormattedtext and refer this code snippet and let us know if this helps. private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1[3,3].CellValueType = typeof(double); this.gridControl1[3,3].CellValue = 0.0; this.gridControl1[3,3].Format = "#"; } private void gridControl1_QueryCellFormattedText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e) { if(e.Style.CellValueType == typeof(double)) { double val; val = (double)e.Style.CellValue; e.Text =val.ToString(); e.Handled = true; } } Here is a sample. format.zip Best Regards, Jeba.

Administrator [Syncfusion]
Replied On September 27, 2005 05:29 PM

Thanks for the explanation. We are going to just go with MS''s convention.

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.

;