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

Some Columns Don't Allow Grouping

1 Answer 33 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
StevenDale asked on 27 Apr 2009, 07:44 PM
I have a RadGridView that is bound to a list of Medication Objects.
A medication contains the following fields:
Drug - object                  Bound to Drug.Name
Dosage - string              Bound to Dosage
StartTime - DateTime     Bound to StartTime
EndTime - DateTime      Bound to EndTIme
Comments - String         Bound to Comments

When the control binds to my list, all of the fields are allowed to be grouped except for the Drug.Name. Is there a way to group this column?

Here is my XAML



<telerik:RadGridView Margin="-2,2,2,-2" AutoGenerateColumns="False" Name="radGridView1" ItemsSource="{Binding PatientMedications}">








<telerik:GridViewDataColumn HeaderText="Name" DataMemberBinding="{Binding Path=Drug_.Name}" UniqueName="{x:Null}"/>




<telerik:GridViewDataColumn HeaderText="Dosage" DataMemberBinding="{Binding Path=Dosage}" UniqueName="{x:Null}" />




<telerik:GridViewDataColumn HeaderText="Started" DataMemberBinding="{Binding Path=StartTime}" UniqueName="{x:Null}" />




<telerik:GridViewDataColumn HeaderText="Ended" DataMemberBinding="{Binding Path=EndTime}" UniqueName="{x:Null}" />




<telerik:GridViewDataColumn HeaderText="Comments" DataMemberBinding="{Binding Path=Comments}" UniqueName="{x:Null}" />










Billy Jacobs


1 Answer, 1 is accepted

Sort by
Rossen Hristov
Telerik team
answered on 28 Apr 2009, 09:43 AM
Hi Billy Jacobs,

In order to enable grouping over that column, you will need to specify its DataType in the following manner:

<Window x:Class="Ticket208384_GroupByCompositeObjectProperty.Window1" 
    Title="Window1" Height="300" Width="300"
        <telerik:RadGridView Margin="-2,2,2,-2"  
                <telerik:GridViewDataColumn HeaderText="Name" 
                        DataType="{x:Type System:String}" 
                        DataMemberBinding="{Binding Path=Drug.Name}" UniqueName="{x:Null}" /> 
                <telerik:GridViewDataColumn HeaderText="Dosage" 
                        DataMemberBinding="{Binding Path=Dosage}" UniqueName="{x:Null}" /> 
                <telerik:GridViewDataColumn HeaderText="Started" 
                        DataMemberBinding="{Binding Path=StartTime}" UniqueName="{x:Null}" /> 
                <telerik:GridViewDataColumn HeaderText="Ended" 
                        DataMemberBinding="{Binding Path=EndTime}" UniqueName="{x:Null}" /> 
                <telerik:GridViewDataColumn HeaderText="Comments" 
                        DataMemberBinding="{Binding Path=Comments}" UniqueName="{x:Null}" /> 

I have prepared and attached a small sample project that demonstrates that. Please examine it and do not hesitate to contact us if you have any other questions.

the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Asked by
Top achievements
Rank 2
Answers by
Rossen Hristov
Telerik team
Share this question