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

Modify Grouping Header

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 25 Jun 2013, 06:14 PM
Hi All,
I have a grid with drag to-group enabled. One of the columns is a template field. The data coming from the DB is a binary mask which I'm "translating" in code-behind to "human-readable" format.
Everything works, but when the grid is grouped by the template field, the group header (obviously) displays the raw data (the binary mask). Is there a way to modify the header display? There's an 'OnGroupsChanging' event, but I can't find the correct property to modify.

Thx in advance.
Rgds - M.

Template Field:
<telerik:GridTemplateColumn SortExpression="MATCH" HeaderText="Match"
                                HeaderButtonType="TextButton"
                                UniqueName="Match" DataField="MATCH"
                                GroupByExpression="MATCH Group By MATCH">
    <ItemTemplate>
        <asp:Label ID="lblMatchColumn" runat="server" Text='<%# GetMatchCodes(Eval("MATCH").ToString()) %>' />
    </ItemTemplate>
</telerik:GridTemplateColumn>

2 Answers, 1 is accepted

Sort by
0
Marcus
Top achievements
Rank 1
answered on 25 Jun 2013, 06:31 PM
Ah, found it -> GroupHeaderTemplate

But it seems if I use the GroupHeaderTemplate I have to define it for every Group-enabled column - correct?


Edit: so I guess I need to check for null values, otherwise I get null-references. That's a lot of spaghetti-code in markup. Is there a better way of doing this?
0
Pavlina
Telerik team
answered on 28 Jun 2013, 04:54 PM
Hi Marcus,

For more information about how to modify grid GroupHeaderItem you can refer to the article below:
http://www.telerik.com/help/aspnet-ajax/grid-customize-gridgroupheaderitem.html

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Marcus
Top achievements
Rank 1
Answers by
Marcus
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or