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

CellType = "Static" and currency format

Thread ID:

Created:

Updated:

Platform:

Replies:

44885 Jun 6,2006 12:25 PM UTC Jun 6,2006 02:13 PM UTC Windows Forms 2
loading
Tags: GridControl
Roberto Martinez
Asked On June 6, 2006 12:25 PM UTC

Hi I want my grid to be static, because the user must not edit nor select any content on the cells, and at the same time i have columns that show currency numbers. I have tried: Grid.TableStyle.CellType = "Static" Grid.TableStyle.CellType = "Currency" but I only can assign one of those values at the same time. How can i make a cell static and, at the same time show its value in currency format?

Administrator [Syncfusion]
Replied On June 6, 2006 12:46 PM UTC

Hi Roberto, There is no built-in support for this. You need to handle the DrawCellDisplayText event for coverting the display text to currency formated text. Here is a code snippet. this.gridControl1.TableStyle.CellType = "Static"; this.gridControl1.TableStyle.CellValue = 45.02; private void gridControl1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) { if(e.RowIndex > 0 && e.ColIndex > 0) { if( e.DisplayText != null && e.DisplayText != string.Empty ) { double d = double.Parse(e.DisplayText); e.DisplayText = string.Format("{0:C}",d); } } } Let me know if you need any further assistance. Best Regards, Haneef

Roberto Martinez
Replied On June 6, 2006 02:13 PM UTC

It works very well thank you

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

;