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

virtual grid: formating cell values

Thread ID:

Created:

Updated:

Platform:

Replies:

39610 Jan 12,2006 04:56 PM UTC Jan 13,2006 09:56 AM UTC Windows Forms 5
loading
Tags: GridControl
Tino
Asked On January 12, 2006 04:56 PM UTC

Hello, i use a virtual grid. In this grid are columns with different formats. In one of these columns i use the type "double". if i put a number like "1.345234 " in the grid and set the format "e.Style.Format = "#.###";", the number is formated to "1.345". If i click in these cell, the value "1.345" remains, but I will that the unformated value "1.345234" appears. The GridSaveCellInfo should save the value "1.345234" and not "1.345". Is it possible?

Tino
Replied On January 12, 2006 05:14 PM UTC

Therefore only if the cell is in edit-mode, the quite number should appear and if i change this number, the quite decimalplaces should be stored.

stanleyj [Syncfusion]
Replied On January 12, 2006 05:44 PM UTC

Hi Tino, DrawCellDisplayText can be made use for your expectation, please comment out Style.Format that was set earlier and try this. private void gridControl1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) { if(e.ColIndex == 4 && e.RowIndex > 0) { double d = (double)e.Style.CellValue; e.DisplayText = string.Format("{0:#.###}", d); } } Best regards, Stanley

Tino
Replied On January 13, 2006 08:38 AM UTC

Hello Stanley, thanx for the fast response. That sounds logic. I have tried, but there is no definition for ''colIndex''in Syncfusion.Windows.Forms.GridDrawCellDisplayTextEventArgs''. Best regards, Tino.

stanleyj [Syncfusion]
Replied On January 13, 2006 09:39 AM UTC

Hi Tino, Refer this sample. If this does not work, check out 4.1 beta here. http://www.syncfusion.com/support/forums/message.aspx?MessageID=39029 Best regards, Stanley

Tino
Replied On January 13, 2006 09:56 AM UTC

O.K. I have tried it at that way: private void gridControl1_DrawCell(object sender, GridDrawCellEventArgs e) { if(e.ColIndex == 1 && e.RowIndex > 0) { e.Style.Format = "0.##"; } } That works. Is this O.k.?

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

;