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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

bold headers and cell format problem

Thread ID:

Created:

Updated:

Platform:

Replies:

17548 Aug 11,2004 01:12 PM UTC Aug 13,2004 06:05 PM UTC WinForms 7
loading
Tags: GridControl
Irina
Asked On August 11, 2004 01:12 PM UTC

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 03:48 PM UTC

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 12:24 PM UTC

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 01:10 PM UTC

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 03:55 PM UTC

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 04:52 PM UTC

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 05:45 PM UTC

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 06:05 PM UTC

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.

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

;