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

Clearing Descriptors from the RadGridView

6 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 23 Feb 2012, 06:41 AM
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

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 23 Feb 2012, 04:47 PM
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 >>
0
Saranya
Top achievements
Rank 1
answered on 28 Feb 2012, 11:28 AM
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
0
Maya
Telerik team
answered on 28 Feb 2012, 12:47 PM
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 >>
0
Saranya
Top achievements
Rank 1
answered on 29 Feb 2012, 07:34 AM
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.

0
Maya
Telerik team
answered on 29 Feb 2012, 09:22 AM
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 >>
0
Saranya
Top achievements
Rank 1
answered on 29 Feb 2012, 01:39 PM
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
Tags
GridView
Asked by
Saranya
Top achievements
Rank 1
Answers by
Maya
Telerik team
Saranya
Top achievements
Rank 1
Share this question
or