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

Format Grid Group Header

1 Answer 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 03 May 2010, 10:30 PM

Hi,

I have groupbyexpressions in my grid as below:

 

<

 

telerik:GridGroupByExpression>

 

 

 

 

 

<SelectFields>

 

 

 

 

 

<telerik:GridGroupByField FieldName="Date" ></telerik:GridGroupByField>

 

 

 

 

 

</SelectFields>

 

 

 

 

 

<GroupByFields>

 

 

 

 

 

<telerik:GridGroupByField FieldName="Date" FormatString="{0:D}"></telerik:GridGroupByField>

 

 

 

</GroupByFields>

 

 

 

 

 

</telerik:GridGroupByExpression>

 

 

 


I want to hide the text 'Date' from the header and just display the actual value. I also want the value to be displayed in bold.

Please suggest.

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 May 2010, 07:45 AM

Hello,

Try out the following code to customize the group header so as to display just the value:

C#:

 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridGroupHeaderItem)  
        {  
            GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;  
            string[] myArr = item.DataCell.Text.Split(':');  
            item.DataCell.Text = myArr[1].Trim();  
            item.DataCell.Style.Add("font-weight""bold");  
        }    
    } 

Also go through the following link which describes on same topic:

Customizing GridGroupHeaderItem

-Shinu.

Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or