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.

Default format issue

Thread ID:

Created:

Updated:

Platform:

Replies:

71506 Feb 3,2008 05:05 AM Feb 11,2008 08:02 AM Windows Forms 3
loading
Tags: GridControl
Manjesh.P.M
Asked On February 3, 2008 05:05 AM

I am able to perform formatting for SummaryRowColumn, using "{Sum:f2}" such type format. But the problem is if i am setting
null in DataType Format then the format goes such a way {Sum:} and the SummaryRowColumn has seen in the earlier format.I need to set
my summaryrowcolumn value corresponding to the values in the column(Default format).

Please help me


Jeba S [Syncfusion]
Replied On February 6, 2008 01:12 AM

Hi Manjesh,

Sorry for the delay in response.

You can apply the same format of the column to the SummaryRowColumn by handling the QueryCellStyleInfo event handler. In the event handler get the format of the column using the GridColumnDescriptor and assign that format to the summary row.


private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
GridTableCellStyleInfoIdentity id = e.TableCellIdentity;
if (id.DisplayElement.Kind == DisplayElementKind.Summary )
{
if (id.SummaryColumn != null
&& id.SummaryColumn.Name == "Sum2")
{
GridTableDescriptor td = e.TableCellIdentity.Table.TableDescriptor as GridTableDescriptor;
GridColumnDescriptor cd = td.Columns[id.SummaryColumn.DisplayColumn];
string format = "{0:" + cd.Appearance.AnyRecordFieldCell.Format + "}";
int iCellValue = Convert.ToInt32(e.Style.CellValue);
e.Style.Text = string.Format(format, iCellValue);
}
}
}


Please refer the sample and let us know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F71506/main.htm

Regards,
Jeba.


Manjesh.P.M
Replied On February 11, 2008 06:37 AM

Thanks a lot for your detailed clarification,
Sorry to tolerate u,

Once again thanks a lotttt


Jeba S [Syncfusion]
Replied On February 11, 2008 08:02 AM

Hi Manjesh,

Thank you for your update.

Regards,
Jeba


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.

;