Saturday, January 24, 2015

RadGridView - Customize the Text of Grouped Row

Default Format for Grouped Row Text in RadGridView


By default, RadGridView appends a ";" to the text of a grouped row, looking like:
remove-semicolon-from-grouped-row
It's pretty ugly.

Customized Grouped Row Text

To remove it, you need to implement the GroupSumaryEvaluate event handler with a customized format.
void radGridView_GroupSumaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
{
 if (e.SummaryItem.FieldName == "Name")
 {
  e.FormatString = String.Format("Name: {0}", e.Value);
 }
}
Here is the final view:
remove-semicolon-from-grouped-row2


Create a Successful Online Store at Bigcommerce! Try it Free Now!

No comments:

Post a Comment