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

[Solved] items.clear and visibility.collapsed not working inside a tab

2 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mark baer
Top achievements
Rank 1
mark baer asked on 28 Oct 2009, 05:57 PM
I have 3 Tabs and three radgrids.  When the user clicks "Reset Search", it is suppose to clear the items in the grid and change the visibility of each grid to collapsed. 

For the 2 grids on tabs that aren't visible, it is working, but for the active tab, the items don't seem to clear and the visibility doesn't change to collapsed.

I am using Silverlight 3 and the latest build of the code that I know of. 

Here is my code:
//clear the coverflow

coverTitles.Visibility =

Visibility.Collapsed;

 

//clear the film grid...
radgridFilm.Items.Clear();

radgridFilm.Rebind();

radgridFilm.Visibility =

Visibility.Collapsed;

 

//clear the sound grid...
radgridSound.Items.Clear();

radgridSound.Rebind();

radgridSound.Visibility =

Visibility.Collapsed;

 

//clear the video grid on the FIRST tab...this Grid is not clearing or changing visibility.
radgridVideo.Items.Clear();

radgridVideo.Rebind();

radgridVideo.Visibility =

Visibility.Collapsed;

Thanks

Mark

 

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 29 Oct 2009, 04:36 PM
Hello mark baer,

You can clear the RadGridView by setting the ItemsSource property to Nothing. That will remove all items and after that you are free to bind to your new collection.
I've tried that approach for you scenario and everything seemed to work fine.
I'm attaching the sample project with our latest binaries (available for download under your client account) for your convinience.

Hope this helps.

Best wishes,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
mark baer
Top achievements
Rank 1
answered on 29 Oct 2009, 04:41 PM
Yup, I found some other code where we were setting ItemSource=null.  That fixed it.  Thanks for writing back.

Mark

Tags
GridView
Asked by
mark baer
Top achievements
Rank 1
Answers by
Missing User
mark baer
Top achievements
Rank 1
Share this question
or