nagaraju

nagaraju

  • NA
  • 87
  • 129.7k

How to get all the records in gridview after paging

Aug 8 2011 5:21 AM

Hi,

I am having 50 questions in gridview. now i am dispalying 5 questions per page.
now i want to retrieve the user selected answers . but with gridview rows event i can able to access only current page questions. but i want all the questions in all pages. how can i achieve this .

foreach (GridViewRow gvrow in GV_Questionpaper.Rows)
        {
            RadioButton Option1 = (RadioButton)gvrow.FindControl("RBtn_Option1");
            RadioButton Option2 = (RadioButton)gvrow.FindControl("RBtn_Option2");
            RadioButton Option3 = (RadioButton)gvrow.FindControl("RBtn_Option3");
            RadioButton Option4 = (RadioButton)gvrow.FindControl("RBtn_Option4");
            if (Option1.Checked)
            {
                answer[i] = Option1.Text;
                i++;
            }
            else if (Option2.Checked)
            {
                answer[i] = Option1.Text;
                i++;
            }
            else if (Option3.Checked)
            {
                answer[i] = Option1.Text;
                i++;
            }
            else if (Option4.Checked)
            {
                answer[i] = Option1.Text;
                i++;
            }
            else
            {
                answer[i] = "Unanswered";
                i++;
                unanswered++;
            }
        }
        foreach (string str in answer)
        {
            Response.Write(str+"\n");
        }

Thanks&Regards
P.Nagaraju

Answers (1)