This is a migrated thread and some comments may be shown as answers.

Appereance of Column Header when using groupBy

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Satyaprakash
Top achievements
Rank 1
Satyaprakash asked on 27 Jun 2008, 07:08 AM
Hi,

When i do group by on a particular column for eg says (A table which has infomation of companies). Suppose i group by Country and City column in that table.
The default group by show the ColumnHeader : Value e.g(Country : England) and (City : London)..

Is  there any way wherein when we do group by only the column value should be visible not its header.

Please provide example code for the same.

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 27 Jun 2008, 04:08 PM
Hi Satyaprakash,

You have an option to format the text displayed for each group-by expression you use in RadGridView. To do this, set the property DefaultFormatString of the corresponding GRidGroupByExpression. You can do this either in the designer or using code:

expression1.DefaultFormatString = "Value of aggregate {0} is {1}"

The format string uses the same rules a string.Fomat method. Parameter {0} stands for the name of the aggregated field and {1} will be replaced by its value.

In your case, the most appropriate format string will be simply "{1}". I'm sending an application that demonstrates this functionality.

Regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Satyaprakash
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or