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

selecting item to put first (on top) in Grouping Categories?

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hazzard
Top achievements
Rank 1
Hazzard asked on 29 Sep 2011, 11:05 PM

This visual snippet indicates what I would like to do. Here is the data being bound to the grid. Move the collection item 'General Info' from the Grouping property bound to the grid from a collection.  It is currently sorted alphabetically.  Below is the Grouping event in the code behind event I think I need? And the xaml below that.  Would I use the Move action (the group descriptor is being moved to another index in the GroupDescriptors collection) to do that? Thank you!

private void rgvPSEProductInfo_Grouping(object sender, Telerik.Windows.Controls.GridViewGroupingEventArgs e)
{
    //    Code for 'Move' method to specify 'General Info' as first item in list?
}

 

<telerik:RadGridView Name="rgvPSEProductInfo" ShowGroupPanel="True"             SelectionChanged="rgvPSEProductInfo_SelectionChanged"  AutoGenerateColumns="False" Grouping="rgvPSEProductInfo_Grouping" Grouped="rgvPSEProductInfo_Grouped" GroupRowIsExpandedChanged="rgvPSEProductInfo_GroupRowIsExpandedChanged" GroupRowIsExpandedChanging="rgvPSEProductInfo_GroupRowIsExpandedChanging" >
    <telerik:RadGridView.Columns>
        <telerik:GridViewCheckBoxColumn  IsReadOnly="False" IsVisible="True"  >
        </telerik:GridViewCheckBoxColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Grouping}" Header="Grouping"  />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Keyword}" Header="Keyword"  />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Information/Item needed:" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Hazzard
Top achievements
Rank 1
answered on 02 Oct 2011, 04:30 PM
I solved the problem using GroupDescriptor per the following xaml:

 

<telerik:RadGridView Name="rgvPSEProductInfo"    ShowGroupPanel="True"  AutoGenerateColumns="False" 
     Grouping="rgvPSEProductInfo_Grouping" >
        <telerik:RadGridView.GroupDescriptors>
             <telerikData:GroupDescriptor Member="PSEType" />
         </telerik:RadGridView.GroupDescriptors>
          <telerik:RadGridView.Columns>
          <telerik:GridViewDataColumn DataMemberBinding="{Binding PSEType}" SortingState="None" Header="PSE Type"   >
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Keyword}" Header="Keyword"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding RequiredInfo}" Header="Required Info"  />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>

 

Tags
GridView
Asked by
Hazzard
Top achievements
Rank 1
Answers by
Hazzard
Top achievements
Rank 1
Share this question
or