Clearing Descriptors from the RadGridView

7 posts, 0 answers
  1. Saranya
    Saranya avatar
    4 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    Hi,

    Scenario is Users can do sorting,Grouping and Filtering on columns. We have a button "Clear Settings", where we are clearing all the Descriptors of the Grid on Click event. Now the issue is after clearing the Descriptors Grid is not displaying any Data, tried with Updatelayout and Rebind the Grid but still it is not showing any data on the Grid but it is cearing all the Descriptors that are set.(like sort,Grouping,Filter). 
    Item Source Collection is showing full count and values of rows, but not displaying the data.
    When i add or remove an object from the Collection , then it is Working.It is not working with Rebind the grid and there is no change in  the collection.
    Using Telerik Grid view version :2011.2.920.1040

    am i mising anything here?



    Regards,
    Sam
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Feb 2012 Link to this post

    Hi Saranya,

    I have tried to reproduce the issue you reported, but still without any success. Could you take a look at the sample attached and let me know whether you can reproduce the same behavior on it ?   


    All the best,
    Maya
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Saranya
    Saranya avatar
    4 posts
    Member since:
    Feb 2012

    Posted 28 Feb 2012 Link to this post

    Hi Maya,

    Thanks for the reply. But still i'm facing the issue. I have a scenario like User can customize the grid by sorting,Grouping,Filtering,show/hdie columns and save the settings as a string. So that the user login in next time,the values will be extracted from string applied to the Grid. We have an another option "Restore to Default setting"  which will clear all the Descriptors.
    So when the page is loaded with the settings that user saved and trying to Restore the Default settings, Descriptors are getting cleared but Grid is not showing any data. Have tried with rebind() ,but it is not working.

    Please help.


    Regards,
    Saranya
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 28 Feb 2012 Link to this post

    Hello Saranya,

    Could you try reproducing the same behavior on the sample I previously attached ? Is there anything that I am missing in its settings ?

    All the best,
    Maya
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Saranya
    Saranya avatar
    4 posts
    Member since:
    Feb 2012

    Posted 29 Feb 2012 Link to this post

    HI Maya,

    I have raised a Support Ticket and Ticket id is 517391 as i was unable to attach the Zip file in this thread. I have attached the Solution by reproducing the issue that i'm facing in the Supprot ticket id "517391". Could you please help me to resolve it.

  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 29 Feb 2012 Link to this post

    Hello Saranya,

    Actually, the issue you encountered is resolved with our official release Q1 2012. However, if you have to work with your current version, you can try the following workaround:

    private void RadButton_Click(object sender, System.Windows.RoutedEventArgs e)
            {
                 
                if (this.MyGrid.clubsGrid.SortDescriptors.Count > 0)
                {
                    this.MyGrid.clubsGrid.SortDescriptors.Clear();
                }
     
                if (this.MyGrid.clubsGrid.GroupDescriptors.Count > 0)
                {
                    this.MyGrid.clubsGrid.GroupDescriptors.Clear();
                    Dispatcher.BeginInvoke(new Action(() => this.MyGrid.clubsGrid.GroupDescriptors.Add(new ColumnGroupDescriptor() { Column = this.MyGrid.clubsGrid.Columns["Established"], SortDirection = ListSortDirection.Ascending })));
                     
                }
     
                if (this.MyGrid.clubsGrid.FilterDescriptors.Count > 0)
                {
                    this.MyGrid.clubsGrid.FilterDescriptors.Clear();
                }
            }


    Greetings,
    Maya
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  7. Saranya
    Saranya avatar
    4 posts
    Member since:
    Feb 2012

    Posted 29 Feb 2012 Link to this post

    Hi Maya,

    Thanks for the Solution. The same issue i'm facing when i'm clearing the Filter Descriptors as well.
    But i need not add any default Filter descriptors programmatically. Just clearing is enough, but after clearing the Filter Descriptor, again Grid is not showing any Data.

    Regards,
    Saranya
Back to Top