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.

bold headers and cell format problem

Thread ID:

Created:

Updated:

Platform:

Replies:

17548 Aug 11,2004 09:12 AM Aug 13,2004 02:05 PM Windows Forms 7
loading
Tags: GridControl
Irina
Asked On August 11, 2004 09:12 AM

Hi Clay, Could you please advise on two simple things, that do not work for me. 1. Cannot set all grid headers in bold. The code doesn''t affect the headers. I set font size which is OK, but cannot set bold by gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.Font.Bold = true; 2.After using code you kindly provided in the posting for summary grid to compute the sum of all columns and rows in CalculateValues() method of GridSummaryRow class, then I try to set format for that cell which shows the sum: this.summaryGrid[1, i + 1].Format = "#0.0"; also tried: this.summaryGrid[1, i + 1].Format =this.grid.Model[1, i + 1].Format; also tried using summaryGrid.Model.... No effect. The value like 23.5 is shown correctly but value with no decimal point is shown as 23 instead of 23.0 Thanks

Administrator [Syncfusion]
Replied On August 11, 2004 11:48 AM

1) Try setting the basetyle on the "Column Header" instead of "Header". this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.Font.Bold = true; 2) If the CellType of these summary cells is not "FormulaCell", then to get the Format to work, you need to set the style.CellValueType = typeof(double).

Irina
Replied On August 13, 2004 08:24 AM

Hi, Clay, Thanks for help. The headers are Ok, Format is correct for all columns except the only one. That column is formula cell on main grid. I set it gdbg.Binder.InternalColumns["gortotal"].StyleInfo.Format = "#0.0"; It is shown correctly on main grid. On summary grid after calculation I set it like you advised: this.summaryGrid[1, i + 1].CellValue = sum; this.summaryGrid[1, i + 1].Format = "#0.0"; this.summaryGrid[1, i + 1].CellValueType = typeof(double); It is shown correctly if sum has decimal point, if not - it is shown like 23 instead of 23.0 Thanks

Administrator [Syncfusion]
Replied On August 13, 2004 09:10 AM

Is this.summaryGrid[1, i + 1].CellType = "FormulaCell"? If sum has already been calculated, then it should not be. It should be CellType = "TextBox" (or maybe "Static"). If it is "FormulaCell", then setting CellValueType = typeof(double) will cause problems which maybe why the formatting is not working properly.

Irina
Replied On August 13, 2004 11:55 AM

It is not "Formula Cell" and sum is already calculated. Actually I did not set CellType. But now I tried both TextBox and Static. The value shown is still the same.

Administrator [Syncfusion]
Replied On August 13, 2004 12:52 PM

Is sum a double? Try using this.summaryGrid[1, i + 1].CellValue = (double) sum; Immediately after setting the format, if you try string s = this.summaryGrid[1, i + 1].FormattedText; What is s?

Irina
Replied On August 13, 2004 01:45 PM

s is 23.0 sum is double and the value of sum is also 23.0, but then it is shown as 23 in the summary grid cell.

Administrator [Syncfusion]
Replied On August 13, 2004 02:05 PM

this.summaryGrid[1, i + 1].FormattedText; should be what will be displayed in the grid cell, so I am not sure why 23.0 is not being shown in the cell. If you can post a sample project showing the problem, we can try to debug it here.

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.

;