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

SelectedItems without ViewState

5 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Greenberg
Top achievements
Rank 1
Mark Greenberg asked on 14 Oct 2009, 11:01 PM
Hello,

I have a RadGrid with 500 records per page and am trying to use the GridClientSelectColumn in conjuntion with the SelectedItems property on the server side.  Given the big page size, I have to have ViewState turned off.  This in turn results in 0 for the value of the SelectedItems property.  Can you please point me to a sample that provides a work around?

Thanks,
Chris

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Oct 2009, 07:27 AM
Hi Chris,

Why not use RadCompression to compress the ViewState instead?

Sincerely yours,
Vlad
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
Jordan Earls
Top achievements
Rank 1
answered on 03 Feb 2010, 12:05 AM
I'm bumping this question.

I can not use viewstate in my application, and the SelectedItems.count is *always* 0, even though I do get the SelectedIndexChanged event fired. How can I solve this? I've also noticed for each datarow, there is a `Selected` field. Well, that selected field is also always false for every field.
0
Princy
Top achievements
Rank 2
answered on 03 Feb 2010, 12:03 PM
Hello Jordan,

The SelectedItems collection is updated on the server-side after a postback occurs. But when the ViewState of the control is disabled, the selected items count(client-side selection), would be equal to zero. Hence, you would have to either set the EnableViewState property of the grid to True or perform selection on the server-side.

-Princy.
0
Jordan Earls
Top achievements
Rank 1
answered on 03 Feb 2010, 08:18 PM
That makes sense, but I don't understand how the Telerik controls actually know the index changed internally if they have no way of knowing the selected rows before and after the selection. And also, is there some javascript or something I can do to force a manual postback on select with some extra data attached to the postback or something? I really need for when the client selects a row(by clicking a row) for it to postback and for the server to know which row they clicked, either by index or by some internal data stored in a cell in the row where the cell has Display=false set.
0
Basel Nimer
Top achievements
Rank 2
answered on 22 Apr 2010, 07:36 PM
BTW: just wanted to mention this maybe it can help someone some day.

i had the same situation, and even if i set enableviewstate i kept getting 0 selecteditems count, the mistake was that the including ajaxpanel had its enableviewstate property set to false.

Tags
Grid
Asked by
Mark Greenberg
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jordan Earls
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Basel Nimer
Top achievements
Rank 2
Share this question
or