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

RadGrid.SelectedItems Problem

3 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 28 Oct 2010, 07:48 PM
Added a GridImageColumn to my grid so I could show a thumbnail image. I was asked to make it toggle on and off via combobox, so I use Page Init and toggle the Visibility property on the GridImageColumn based on the selection from the combo.

Test 1: If the page initially loads in Thumbnail View mode and I select items and hit Add to Cart, all is good. 
Test 2: If the page initially loads in List View Mode and I select items and hit Add to Cart, all is good
Test 3: If I toggle from Thumbnail to List View Mode and then select items and hit Add to Cart, my RadGrid.SelectedItems collection is empty? The same goes for initial load in List and toggle to Thumbnail.

How would the visibility of the column have anything to do with it being selected or not when I am doing everything the same

Thanks,
Jason

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 02 Nov 2010, 04:26 PM
Hi Jason,

Are you rebinding the grid while changing between modes?
Note that the grid selected items are cleared after rebind. You can try the solutions provided in the below articles to overcome that issue:

http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html
http://www.telerik.com/help/aspnet-ajax/grdpersistselectedrowsonsorting.html

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jay
Top achievements
Rank 1
answered on 03 Nov 2010, 08:06 PM
Hi Lana,
Yes, I am rebinding the grid between mode changes but I am also re-selecting the grid items prior to clicking Add to Cart.
One note is that I am not using check boxes here, only highlighting the rows and hitting Add to Cart.
That shouldn't matter should it?
Jason
0
Iana Tsolova
Telerik team
answered on 09 Nov 2010, 11:26 AM
Hi Jason,

Can you try puting the code for re-selecting the items on RadGrid PreRender and see if it makes any difference? I assume that Add to Carrt button rebinds the grid as well, right?

Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Jay
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Jay
Top achievements
Rank 1
Share this question
or