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

2 posts, 0 answers
  1. Hazzard
    Hazzard avatar
    24 posts
    Member since:
    May 2006

    Posted 29 Sep 2011 Link to this post

    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>
  2. Hazzard
    Hazzard avatar
    24 posts
    Member since:
    May 2006

    Posted 02 Oct 2011 Link to this post

    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>

     

Back to Top