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

[Solved] Changing GroupBy Field Text

2 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkat Ganesh
Top achievements
Rank 1
Venkat Ganesh asked on 21 Aug 2009, 06:26 PM
Hi,

How to change the GridGroupByField header text to a value which is not part of GroupByFields?

Thanks

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Aug 2009, 04:39 AM
Hello Venkat,

Refer to the following help document which explains on how to alter the group header text with a custom text. This should definitely help you out to achieve the required.
Customizing GridGroupHeaderItem

Thanks
Shinu.
0
Venkat Ganesh
Top achievements
Rank 1
answered on 24 Aug 2009, 10:22 PM
Shinu,

The link you provided is not compltely helpful because, in the link UnitPrice and InStock are part of GroupByExpression.
I want access other cols like 'ProductName' inside

if (e.Item is GridGroupHeaderItem)
 {
   GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
   DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
   item.DataCell.Text = "$" + groupDataRow["UnitPrice"].ToString() +
      " (" + groupDataRow["InStock"].ToString() + ")";
 }
Tags
Grid
Asked by
Venkat Ganesh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Venkat Ganesh
Top achievements
Rank 1
Share this question
or