Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Gridview + RadioButtons + Paging losing state

Thread Tools

Gridview + RadioButtons + Paging losing state

Posts: n/a
Hi All,

I have a gridview in a wizard where you can select an event in a radio
button for each row in the gridview.
So when you have checked the radiobutton, you would have to press 'next' in
the wizard to advance to the next step.
Problem is that when I enable paging and sorting for the gridview, when I
have selected a radiobutton in e.g. page 1, the selection is not remembered
when paging back to Page 1.

The Gridview looks like this

<asp:GridView ID="gvEvents" runat="server" AutoGenerateColumns="false" >
<asp:TemplateField HeaderText="Select">
<vs:GroupRadioButton id="selectRadioButton" runat="server"
AutoPostBack="true" GroupName="event" />
<asp:BoundField DataField="seqevent" HeaderText="Primary Key"
SortExpression="seqevent" />
<asp:BoundField DataField="eventName" HeaderText="Name"
SortExpression="eventName" />

if (!Page.IsPostBack)
gvEvents.AllowPaging = true;
gvEvents.AllowSorting = true;
gvEvents.AutoGenerateColumns = false;
gvEvents.PageSize = 5;
gvEvents.DataSourceID = "odsEvents";


I also use for
radiobutton grouping, otherwise i could select multiple radiobuttons in one

I also tried to put the selectedcontrol in the sessionstate and resetting
every time, but that does not work either:

selecteditem = (string)Session["event"];
if (selecteditem != null)
radiobutton =
(Sf.BL.Navigation.GroupRadioButton)Page.FindContro l(selecteditem);
radiobutton.Checked = true;

If I advance to a next step in the wizard, the selected radiobutton is
remembered if I have e.g. selected an item in the first page and going to
the next and previous page.

Any thoughts welcome !

Kind Regards,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UserControl, Radiobutton, Wizard : Problem in keeping the state ofthe Radiobuttons Florian Paulus ASP .Net 0 11-14-2008 09:12 AM
Gridview and Radiobuttons ASP .Net 0 04-28-2008 07:34 PM
Losing Drives - Finding Drives - Losing Drives Computer Support 2 09-21-2007 10:16 PM
posting radiobuttons inside a gridview do not persist selection after postback.. Carlos ASP .Net 10 12-05-2006 04:36 PM
Losing Session State on a State Server Vinay Joseph Mathew ASP .Net 3 09-16-2004 05:09 PM