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

Radgrid Grouping Group Header Text

2 Answers 307 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MarkSci
Top achievements
Rank 1
MarkSci asked on 27 Apr 2012, 05:04 PM
Hi everyone,

I have a radgrid which is created enitrely within the code behind. I have enabled grouping which works (sort of - minimising the group doesn't currently work although the page is refreshing), however each group's header text defaults to the following format:

[Grid ColumnName]: [BoundDataField value]

One of my columns contains an image determined by the underlying data - which doesn't necessarily make sense to the users and contains capital letters and underscores. Screenshot attached. Is there a way of intercepting this and changing the text?

Thanks

Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 30 Apr 2012, 06:55 AM
Hello Mark Sci,

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridGroupHeaderItem)
        {
            (e.Item as GridGroupHeaderItem).DataCell.Text = (e.Item as GridGroupHeaderItem).DataCell.Text.Replace("_"," ");
        }
}



Thanks,
Jayesh Goyani
0
MarkSci
Top achievements
Rank 1
answered on 30 Apr 2012, 08:28 AM
Perfect, thank you Jay!
Tags
Grid
Asked by
MarkSci
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
MarkSci
Top achievements
Rank 1
Share this question
or