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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

"#" format and 0 in virtual grid

Thread ID:





35225 Sep 26,2005 11:30 PM UTC Sep 27,2005 09:29 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On September 26, 2005 11:30 PM UTC

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 11:47 AM UTC

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 09:29 PM UTC

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


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