4 Answers, 1 is accepted
0
Hi Jeff,
You can use the following code to style a specific item:
Please note that for summary cells/rows you need to use the ViewRowFormatting and ViewCellFormatting events.
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
You can use the following code to style a specific item:
private
void
RadGridView1_ViewRowFormatting(
object
sender, RowFormattingEventArgs e)
{
if
(e.RowElement.RowInfo
is
GridViewSummaryRowInfo)
{
var row = e.RowElement.RowInfo
as
GridViewSummaryRowInfo;
if
(row.SummaryRowItem[0].Name ==
"Freight"
)
{
}
}
}
Please note that for summary cells/rows you need to use the ViewRowFormatting and ViewCellFormatting events.
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jeff
Top achievements
Rank 1
answered on 13 Nov 2017, 06:33 PM
Thanks, Dimitar. I'm not sure I see in your code how to only perform an action if only a certain summary row is active.I am looking for something that let's me do something like this (assume I have 2 summary rows):
Here is the p-code:
If summaryrow is the first one of the two then set the backcolor to yellow
or
If summaryrow is the second one then set the "Freight" cell ONLY IN THAT SUMMARY ROW to a blue forecolor
Your comment suggests that each SummaryRowItem has a unique name, but I thought the name referred to the column to summarize. Is that not correct?
0
Hello Jeff,
If you need to change the styles of a single cell you should use the ViewCellFormatting event. I have prepared a small example that shows how you can achieve the desired styling.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
If you need to change the styles of a single cell you should use the ViewCellFormatting event. I have prepared a small example that shows how you can achieve the desired styling.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jeff
Top achievements
Rank 1
answered on 14 Nov 2017, 04:53 PM
Thanks, Dimitar. That gave me what I was looking for.