Hi Sergio,
Thanks for your interest in syncfusion products.
Query: Format the
gridSummary row descriptor |
If you want to customize the backcolor of a GridSummaryRow
descriptor, please make use of the following UG links for better
understanding. |
UG Link:1. http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!documents/exploringsummaries.htm
Please let me know if you have any other concerns.
Regards,
Arun.
Hi Serigo,
Thanks for the update.
Query: Summary row back
color |
Sorry for the delay. There are some network problem in
updating. To change the summary row backcolor. You have to create instances
for the summary row descriptor. And using it you can change the color of the
summary row. Regarding achieving the behavior while formatting rows, please
customize your conditions in querysellstyleinfo event. Please make use of the
attached sample. |
Code Snippet:
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs
e) {
//Please check your conditions here(i.e:
when you ant to change the color of summary row descriptor... if
(e.TableCellIdentity.TableCellType == GridTableCellType.SummaryFieldCell)//e.TableCellIdentity.TableCellType ==
Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.AnySummaryCell) {
srd.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right;
srd.Appearance.AnyCell.BackColor = Color.Red;
srd.Appearance.AnyCell.HorizontalAlignment
= GridHorizontalAlignment.Right;
srd.Appearance.AnyCell.BackColor = Color.Green; } } |
Please let me know if you have any other concerns.
Regards,
Arun.
Hi
Sergio,
Thanks for your update.
You can make use of "QueryCellInfo" event to color the summary row.
In order to color the cells based on the condition column>value, you can
make use of the following code in event:
if (e.TableCellIdentity.TableCellType ==
GridTableCellType.SummaryFieldCell)//e.TableCellIdentity.TableCellType ==
Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.AnySummaryCell)
{
if(e.TableCellIdentity.ColIndex>2)
grid.Appearance.AnyCell.BackColor = Color.Black;
else
grid.Appearance.AnyCell.BackColor = Color.Green;
}
Please let me know if you have any concerns.
Regards,
Athiram S
HI Sergio,
Sorry for the inconvenience caused with delay.
Query Formatting the
summary row. |
We have analyzed your query. The
GridConditionalFormatDescriptor class provide support to apply formats based
on the expression in which the column will keep track only the record values.
Hence, the conditional formats cannot be applied for summaryrow and
summarycaptionrow. However, you can apply the formats based on condition to
the summary row by handling the QueryCellStyleInfo event. Here is some code
for your reference in which this has been done. void
gridGroupingControl1_QueryCellStyleInfo(object
sender, GridTableCellStyleInfoEventArgs e) { if
(e.TableCellIdentity.TableCellType == GridTableCellType.SummaryFieldCell) { Element
el = e.TableCellIdentity.DisplayElement; GridTable
table = e.TableCellIdentity.Table; GridSummaryRow
row = e.TableCellIdentity.DisplayElement as GridSummaryRow; GridSummaryRowDescriptor
summaryRowDescriptor = row.SummaryRowDescriptor; GridSummaryColumnDescriptor
sumCol1 = summaryRowDescriptor.SummaryColumns[0]; if
(el.Kind == DisplayElementKind.Summary) { if
(sumCol1 != null) { string text1 = sumCol1.GetDisplayText(table, row); double value = double.Parse(text1); if
(e.TableCellIdentity.SummaryColumn.Name == "QuantityTotal"
&& value > 10) {
summaryRowDescriptor.Appearance.AnyCell.BackColor = Color.Red; } if
(e.TableCellIdentity.SummaryColumn.Name == "QuantityDistinctCount"
&& value >= 50) {
summaryRowDescriptor.Appearance.AnyCell.BackColor = Color.White; e.Style.TextColor
= Color.Blue; } if (e.TableCellIdentity.SummaryColumn.Name == "QuantityMedian" ) {
summaryRowDescriptor.Appearance.AnyCell.BackColor = Color.Green; } } } } } Please refer the attached sample file also which is
modified with the above codes. We hope this will help to you to implement the same
behavior in your application. |
Please let me know if you need more information about this.
Regards,
Vinish.
Hi Serigo,
Please let me know if the issue still exits. We will help you as soon as possible.
Regards,
Arun.