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

[Solved] Change description when grouping by boolean

1 Answer 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 28 Apr 2008, 02:44 PM
Hi,

I have a RadGrid with several checkboxes and I need people to be able to group by them.  For example I have a field called LIVE which they will want to group by to see the live actions separate from completed (non-live) actions.

When I group now - it works, but I get groups of True/False as it is a checkbox field.  Is it possible to specify text such as "Yes" or "No" instead, or even "Live Issues", "Completed Issues" as the header of each group instead of true/false.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Stephen
Top achievements
Rank 1
answered on 28 Apr 2008, 05:43 PM
FYI,

I answered my own question (theres a first!).  In ItemDataBound

If

TypeOf e.Item Is GridGroupHeaderItem Then

Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)

Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView)

Dim column As DataColumn

For Each column In groupDataRow.DataView.Table.Columns

'Check the condition and add only the field you need

If column.ColumnName = "LIVE" Then

'Clear the present text of the cell

item.DataCell.Text =

""

item.DataCell.Text += IIf(

Boolean.Parse(groupDataRow("LIVE").ToString), "Active Issues", "Resolved Issues")

End If

Next column

End If

Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Stephen
Top achievements
Rank 1
Share this question
or