sort column does not work

5 posts, 0 answers
  1. Alex
    Alex avatar
    36 posts
    Member since:
    Sep 2010

    Posted 23 Dec 2011 Link to this post

    Please have a look at the code below - does it work for you? For some reason the sort column does not work. Thanks


    <
    Grid >
        <Grid.RowDefinitions>
            <RowDefinition
                Height="*" />
            <RowDefinition
                Height="Auto" />
        </Grid.RowDefinitions>
     
        <decodeHelpers:RadGridViewExt
                    x:Name="GridViewMessages"
                    Background="White"
                    ScrollViewer.HorizontalScrollBarVisibility="Auto"
                    ScrollViewer.VerticalScrollBarVisibility="Auto"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    AutoGenerateColumns="False"
                    IsReadOnly="True"
                    ShowColumnFooters="False"
                    EnableColumnVirtualization="True"
                    EnableRowVirtualization="True"
                    VirtualizingStackPanel.VirtualizationMode="Recycling"
                    ShowGroupPanel="False"
                    Grid.Row="0" CanUserSortColumns="True"
                    CanUserFreezeColumns="False"
                    RowIndicatorVisibility="Collapsed"
                    SelectionMode="Extended"
                    SelectionUnit="Cell"
                    ClipboardCopyMode="All"
                    HierarchyChildTemplate="{StaticResource childGridView}"
                    ItemsSource="{Binding Data, ElementName=GridViewDomainDataSource}"
                    RowIsExpandedChanging="GridViewMessages_RowIsExpandedChanging">
     
            <decodeHelpers:ContextMenuExtended.ContextMenu>
                <decodeHelpers:ContextMenuExtended x:Name="MessagesContextMenu" Opened="ContextMenu_Opened">
                    <decodeHelpers:ContextMenuExtended.Items>
                    </decodeHelpers:ContextMenuExtended.Items>
                </decodeHelpers:ContextMenuExtended>
            </decodeHelpers:ContextMenuExtended.ContextMenu>
     
            <decodeHelpers:RadGridViewExt.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="ID" Width="Auto" MinWidth="50" IsFilterable="False"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding MessageTypeID}" Header="Type" Width="Auto" MinWidth="60"/>
     
            </decodeHelpers:RadGridViewExt.Columns>
     
            <decodeHelpers:RadGridViewExt.ChildTableDefinitions>
                <telerik:GridViewTableDefinition/>
            </decodeHelpers:RadGridViewExt.ChildTableDefinitions>
     
        </decodeHelpers:RadGridViewExt>
     
        <telerik:RadDataPager Name="RadDataPagerMessages" Grid.Row="1"
                              Source="{Binding Data, ElementName=GridViewDomainDataSource}"
                              IsTotalItemCountFixed="False" PageSize="50" Margin="0,0,0,4"
                              DisplayMode="All"/>
    </Grid>
    <riaControls:DomainDataSource  x:Name="GridViewDomainDataSource"
                                          QueryName="GetMessages"
                                          AutoLoad="False"
                                          LoadSize="100"
                                          PageSize="50"
                                          LoadedData="GridViewDomainDataSource_LoadedData">
     
                <riaControls:DomainDataSource.DomainContext>
                    <context:SomethingContext/>
                </riaControls:DomainDataSource.DomainContext>
     
            </riaControls:DomainDataSource>
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 26 Dec 2011 Link to this post

    Hi Alex,

      Such a code works fine at my end.
      By default the sorting feature of RadGridView gets disabled when it is not possible to determine any order for the elements of the respective type. Can your data be sorted on any of the bound 'ID' or 'MessageTypeID' properties?

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Alex
    Alex avatar
    36 posts
    Member since:
    Sep 2010

    Posted 03 Jan 2012 Link to this post

    thanks for your reply

    What do you mean by "Can your data be sorted on any of the bound 'ID' or 'MessageTypeID' properties?" I want users to be able to sort data at any time by clicking at the column header

    My domain service returns an ObservableCollection. I wonder if it is anything to do with that?

     

     

     

     

     

  4. Alex
    Alex avatar
    36 posts
    Member since:
    Sep 2010

    Posted 05 Jan 2012 Link to this post

    I still have this issue. I tried using RadDomainDataSource and my data does not load at all. Could you share the code you tested please?
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Jan 2012 Link to this post

    Hello,

     Please take a look at this forum post where a similar topic is discussed. There is a sample project attached as well.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top