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.

CellType = "Static" and currency format

Thread ID:





44885 Jun 6,2006 08:25 AM Jun 6,2006 10:13 AM Windows Forms 2
Tags: GridControl
Roberto Martinez
Asked On June 6, 2006 08:25 AM

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 08:46 AM

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 10:13 AM

It works very well thank you


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.