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

GroupPanel Header values

4 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dasha
Top achievements
Rank 1
Dasha asked on 14 Jul 2011, 03:19 PM
Dear Support,

I have grouping enabled server-side. In the attached image you see that my grid is grouped by 2 columns: Status and Priority.  I don't want the "Status" label to be visible in my group header, but the problem is that if I set 
gridGroupByField.HeaderText = " ";

then the group panel header shows up as empty.  All my groups are dynamically defined, so I don't know ahead of time which will want the column name to show up and which won't.  Is there a way for me to set the GroupPanel header values?

4 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 20 Jul 2011, 10:05 AM
Hello Dasha,

Please use the following code to set the field alias when grouping:
<telerik:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status"
    UniqueName="Status" GroupByExpression="Status as [ ] Group By Status">
</telerik:GridBoundColumn>

I hope this helps.

Greetings,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Dasha
Top achievements
Rank 1
answered on 21 Jul 2011, 11:01 AM
I'm setting up my columns programmatically and for some reason this method is not creating the groupings.  Also, I tried to set the GridGroupByEsxpression.Expression property, but the result is the same, the column name shows up as " " in both places.
0
Mira
Telerik team
answered on 21 Jul 2011, 12:39 PM
Hello Dasha,

Please make sure that you create the grid according to the Programmatic Creation help topic.
In order to implement the desired functionality, I recommend that you set the GroupByExpression property of the corresponding column when creating it:
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
boundColumn.HeaderText = "Status";
boundColumn.GroupByExpression = "Status as st Group By Status";

I hope this helps.

Regards,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Dasha
Top achievements
Rank 1
answered on 21 Jul 2011, 12:48 PM
I will keep trying to get this approach to work, I must be doing something wrong.  Assuming I do get the grouping to work this way, and I set the alias to be empty ([ ]), will the ":" header value separator still show up? Do I have any control over the format?  Suppose I wish to add an item count in the form "In Progress (7)", where "In progress" in the group value, and 7 is the number of grouped items.  I'm looking here: http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.gridgroupbyexpression-expression.html, and I can see that I can add something like "count(Country) Items", which will add a count like "Items: 7", but I want to show it like (7), how would I do that?
 
Tags
Grid
Asked by
Dasha
Top achievements
Rank 1
Answers by
Mira
Telerik team
Dasha
Top achievements
Rank 1
Share this question
or