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

How to get rid of Alias in Groupheader?

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bb
Top achievements
Rank 1
bb asked on 14 Jan 2011, 10:06 PM
Sorry if this is too basic a question, just got started.

I was trying grouping in RadGrid, all went fine except in the group header, it always shows FieldNameOrAlias : FieldValue.  I just want the Value in the group header, not prefixed with Name:  So instead of

My Country: Argentina; My Items: 3; Group Total : $8,119.10

I want something like

Argentina       3               $8,119.10

Can this be done, declaratively or programmatically, without looping through OnItemDataBound?  Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Jan 2011, 05:41 AM
Hello,

Try the following code snippet to hide the Field name in Group header.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
 {
   if (e.Item is GridGroupHeaderItem)
   {
    GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)e.Item;
     {
       groupHeader.DataCell.Text = groupHeader.DataCell.Text.Split(':')[1].ToString() ;
     }
   }
  }

Thanks,
Princy.
Tags
Grid
Asked by
bb
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or