Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7912081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:29:15+00:00 2026-06-03T13:29:15+00:00

I have gridview which contains 60 rows and each row has 4 radiobutton option

  • 0

I have gridview which contains 60 rows and each row has 4 radiobutton option (select any one). To opearate that code , on submit button wrote code as follows . I didn’t work.
My design view :

<asp:GridView ID="gvSurvey" runat="server" CellPadding = "4"  OnRowDataBound ="gvSurvey_RowDataBound" BorderWidth ="2"
AutoGenerateColumns="False" EmptyDataText="No data Available" GridLines="None"
HorizontalAlign="Center" ForeColor="#333333" Font-Names="Verdana" ShowFooter="True">
<RowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="HEADER" HeaderText="Description" ItemStyle-HorizontalAlign="Left"
FooterStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="QTN_NO" HeaderText="Description" ItemStyle-HorizontalAlign="Left"
FooterStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="SQTN_NO" HeaderText="Description" ItemStyle-HorizontalAlign="Left"
FooterStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField Visible="true" HeaderText ="Strongly Disagree">
<ItemTemplate>

<asp:RadioButton ID="rdbtn1" runat ="server" GroupName ="MyRadioGroup"/>
<%-- <asp:CustomValidator ID="cvRadioButtonGroup" runat="server" ErrorMessage="* make a selection" onservervalidate="cvRadioButtonGroup_ServerValidate" /> --%>
  <%--<input name="MyRadioButton1" type ="radio" value = "'<%# Eval("SQTN_NO") %>'" />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" HeaderText ="Agree">
<ItemTemplate>
  <asp:RadioButton ID="rdbtn2" runat ="server"  GroupName ="MyRadioGroup"/>
  <%--<asp:CustomValidator ID="cvRadioButtonGroup" runat="server" ErrorMessage="* make a selection" onservervalidate="cvRadioButtonGroup_ServerValidate" /> --%>
 <%--<input name="MyRadioButton2" type ="radio" value = "'<%# Eval("SQTN_NO") %>'" />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" HeaderText ="Disagree">
<ItemTemplate>
  <asp:RadioButton ID="rdbtn3" runat ="server" GroupName ="MyRadioGroup"/>
  <%-- <asp:CustomValidator ID="cvRadioButtonGroup" runat="server" ErrorMessage="* make a selection" onservervalidate="cvRadioButtonGroup_ServerValidate" /> --%>
  <%--<input name="MyRadioButton3" type ="radio" value = "'<%# Eval("SQTN_NO") %>'" />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" HeaderText ="Strongly Agree">
<ItemTemplate>
  <asp:RadioButton ID="rdbtn4" runat ="server"  GroupName ="MyRadioGroup"/>
      <%--  <asp:CustomValidator ID="cvRadioButtonGroup" runat="server" ErrorMessage="* make a selection" onservervalidate="cvRadioButtonGroup_ServerValidate" /> --%>
<%-- <input name="MyRadioButton4" type ="radio" value = "'<%# Eval("SQTN_NO") %>'" />--%>
</ItemTemplate>

</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />

</asp:GridView>

C#

 for (i = 0; i < gvSurvey.Rows.Count; i++)
            {
                RadioButton rdbtn1 = (RadioButton)gvSurvey.Rows[i].Cells[3].FindControl("rdbtn1");
                RadioButton rdbtn2 = (RadioButton)gvSurvey.Rows[i].Cells[4].FindControl("rdbtn2");
                RadioButton rdbtn3 = (RadioButton)gvSurvey.Rows[i].Cells[5].FindControl("rdbtn3");
                RadioButton rdbtn4 = (RadioButton)gvSurvey.Rows[i].Cells[6].FindControl("rdbtn4");


          //      RadioButton rdbtn1=(RadioButton) gvSurvey.Rows[i].ClientID  

                qtn_no = dtSurvey.Rows[i]["QTN_NO"].ToString();
                sqtn_no = dtSurvey.Rows[i]["SQTN_NO"].ToString();

                if (rdbtn1.Checked)
                {
                    rdbtn1.Text = "1";
                    lblMsg.Text = nominationsBiz.SaveSuggestion(ticketNo.ToString(), qtn_no, sqtn_no, rdbtn1.Text);
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:29:17+00:00Added an answer on June 3, 2026 at 1:29 pm

    Please Go through the following code you will find the Solutions

     //  It will be on your submit button click 
        protected void getPinCode()
        {
            foreach (GridViewRow grdRows in gvSurvey.Rows)
            {
                RadioButton rbt1 = (RadioButton)grdRows.FindControl("rdbtn1");
                RadioButton rbt2 = (RadioButton)grdRows.FindControl("rdbtn2");
                RadioButton rbt3 = (RadioButton)grdRows.FindControl("rdbtn3");
                RadioButton rbt4 = (RadioButton)grdRows.FindControl("rdbtn4");
    
                string Value = RadioValue(rbt1);
               //Similarly you can do for all radio button 
                if(!string.IsNullOrEmpty(Value))
                {
    
                    lblMsg.Text = nominationsBiz.SaveSuggestion(ticketNo.ToString(), qtn_no, sqtn_no, Value);
                }
    
            }
        }
    
    
        protected string RadioValue(RadioButton Rbtlst)
        {
            string Value = "";
    
            if (Rbtlst.Checked == true)
            {
                Value = Rbtlst.Text;
            }
            return Value;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview that contains a column name History which has Plus (+)
I have a form that contains a GridView control which is databound to an
I have GridView which I can select a row. I then have a button
Hello I have created and application which contains a gridview that is populated by
A typical situation: In my GridView control, I have a Footer row which contains
I have a GridView which may contain 10's and 100's of rows, on each
I have a gridview in which every row contains a dropdownlist. I want to
Situation: I have several Gridviews on one page, and each Gridview has a dynamically
I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like
Here i have gridview which contain some values retrieved from database.We put radiobutton list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.