Hi SriRajan
Thank you, for your kind help. We tried that solution here now we are able to limit the summery column value. By setting the following formats we are able to limit the summery column values.
{Sum:##.#0} – Display will be 123.12
{Sum:f2} – Display will be 123.12
{Sum:f3} – Display will be 123.123
{Sum:c3}– Display will be $123.123 etc
But still there are some issues.
When we tried to set the summery row column for “Double Aggregate Type” as D (Decimal type), X (Hexa decimal), T (Truncated) etc then the summery row gets disappeared.
EX {Sum:D}
It will be very much helpful for me if you suggest any solution regarding this.
Regards
Hareesh
>Hi Hareesh,
Thank you for your interest in Syncfusion products.
To limit the decimal value by 2 using F2, You need to handle TableControlCurrentCellKeyDown and restrict the decimal value by 2 by setting the format using the code sd.Format = "{Sum: ##.#0}. Please refer the below code for more details.
private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if (e.Inner.KeyCode == Keys.F2)
{
GridSummaryColumnDescriptor sd = new GridSummaryColumnDescriptor();
sd.DataMember = "Col2";
sd.DisplayColumn = "Col2";
sd.Format = "{Sum: ##.#0}";
sd.SummaryType = SummaryType.DoubleAggregate;
this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Col2", "Sum :", sd));
sd.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Left;
}
}
Please refer to the attached sample for more details.
http://websamples.syncfusion.com/samples/Grid.Windows/71465/main.htm Please let me know if this helps.
Regards,
Srirajan