Re-Sorting Columns causes data to disappear?

5 posts, 0 answers
  1. Jeff
    Jeff avatar
    12 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2011 Link to this post

    Hello all,

        I am working with a Telerik grid that loads Employee data with multiple columns. The grid loads Employee information based on a ClientId. The data in the grid loads and displays just fine when I initially open the grid. However, after selecting a column header to re-sort the column (either in ascending or descending order), the data seems to disappear. Our team has recently updated our Silverlight app from the Trial Version. I wasn't sure if this would cause any type of problem because re-sorting a particular column seemed to work fine with the trial version. Let me know if you have any ideas, thanks.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Oct 2011 Link to this post

    Hi,

     Can you post the grid version? More info about how exactly the grid is bound and/or any custom xaml/code will be helpful as well. 

    Best wishes,
    Vlad
    the Telerik team

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

  3. Jeff
    Jeff avatar
    12 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2011 Link to this post

    Yes the itemsource is bound to a CollectionView..

    The the viewmodel consists of a loading method that consists of .. 
      
    if (client != null)
                {
                    EmployeeSearchService.Clear<EmployeeBasic>();
      
                    //Performs a paged load of the employee list of data.
                    Action<int> pagedLoad = null;
                    pagedLoad = (skip) =>
                        {
                            var filter = new QueryBuilder<EmployeeBasic>()
                                .Where(e => e.ClientId == client.ClientId && e.Status == "Active")
                                .OrderBy(e => e.FullName)
                                .Skip(skip)
                                .Take(TAKE);
      
                            filter.RequestTotalItemCount = true;
      
                            EmployeeSearchService.LoadEmployeeBasic(filter)
                                   .Subscribe((slr) =>
                                   {
                                       if (slr.TotalEntityCount > TAKE)
                                       {
                                           pagedLoad(skip + TAKE);
                                       }
                                   });
                        };
      
                    pagedLoad(INITIALSKIP);
                }

    This again, seems to work just fine when the grid is initially open. It just disappears when re-sorting the column to ascending/descending order. In order to re-retrieve the data to be seen in the grid, I have to select a new clientId.

    The XAML for the fomation of the grid looks like...
                      <telerik:RadGridView x:Name="radGridView"
                                     Grid.ColumnSpan="2"
                                     HorizontalAlignment="Stretch"
                                     AutoGenerateColumns="False"
                                     DataLoadMode="Asynchronous"
                                     IsFilteringAllowed="True"
                                     IsReadOnly="True"
                                     ItemsSource="{Binding Employees}"
                                     RowIndicatorVisibility="Collapsed"
                                     ShowGroupPanel="False">


    The XAML for a specific the name column for example looks like..
    <telerik:GridViewDataColumn DataMemberBinding="{Binding ClientId}"
                                                    Header="{Binding Strings.ClientId,
                                                    Source={StaticResource EmployeeResources}}"
                                                    IsSortable="True" />
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Oct 2011 Link to this post

    Hello Jeff,

     Please remove DataLoadMode="Asynchronous" - your service is already asynchronous and you do not need this setting. 

    Best wishes,
    Vlad
    the Telerik team

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

  5. Jeff
    Jeff avatar
    12 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2011 Link to this post

    Vlad,

       Problem solved! Thank you very much.
Back to Top