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 8317227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:32:42+00:00 2026-06-08T21:32:42+00:00

I’ve got a gridview (asp.net) with a checkbox and a radiobuttonlist. Above this gridview

  • 0

I’ve got a gridview (asp.net) with a checkbox and a radiobuttonlist.
Above this gridview I have a button that allows the user to set all SELECTED items
in the gridview to a particular value. What I mean by selected is that checkbox that is inside the gridview is checked. This gridview is inside an updatepanel and I dont know if this is the reason I am having an issue but here is my issue.

The gridview as I said has a checkbox like so:

 <ItemTemplate>
  <asp:CheckBox ID="chkSelector" runat="server" 
    ToolTip="Select row?" />
 </ItemTemplate>

And a radiobutton list like so:

 <asp:RadioButtonList ToolTip="Please provide an answer to the method." AutoPostBack="true" RepeatDirection="Horizontal" ID="rbAnswer" runat="server" SelectedValue='<%# DataBinder.Eval(Container, "DataItem.AnswerID")%>' OnSelectedIndexChanged="rbAnswer_SelectedIndexChanged">
                                    <asp:ListItem Text="Yes" Value="Yes" style="color:green;"></asp:ListItem>
                                    <asp:ListItem Text="No" Value="No" style="color:red;"></asp:ListItem>
                                    <asp:ListItem Text="N/A" Value="N/A" style="color:gray;"></asp:ListItem>
                                    <asp:ListItem Value="" Text="" style="display: none" />
                                </asp:RadioButtonList>

When you check the checkbox (you can select multiple checkbox (line items in the grid) and then click this button. The button does something to this effect:

foreach (GridViewRow Row in this.gvLineItems.Rows)
                {
                    CheckBox cb = (CheckBox)Row.FindControl("chkSelector");
                    Label id = (Label)Row.FindControl("lblID");
                    if (cb != null && cb.Checked)
                    {
                        long lID = Convert.ToInt32(gvLineItems.DataKeys[Row.RowIndex].Value);
                        RadioButtonList rbl = (RadioButtonList)Row.FindControl("rbAnswer");

                        rbl.Items.FindByText("N/A").Selected = true;
                    }
                }

That is it loops through all items in the gridview. If the item is checked (chkSelector = true) then it sets the radiobutton list answer to “N/A”. I debug the code and I can see the answer is set correctly but then when my method is done the User Interface doesnt show the result. Meaning the answer was never set to N/A. It just maintains its original state…

Does anyone know why this is happening? I am using an updatepanel around this so I am not sure if that is the reason
???

  • 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-08T21:32:43+00:00Added an answer on June 8, 2026 at 9:32 pm
    <asp:ListItem Text="N/A" Value="N/A" style="color:gray;"></asp:ListItem>
    
    for (int i = 0; i < gvLineItems.Rows.Count; i++)
    {   
     CheckBox cb = (CheckBox)gvLineItems.Row[i].FindControl("chkSelector");   
     RadioButtonList rbl = (RadioButtonList)gvLineItems.Row[i].FindControl("rbAnswer");
     if(cb.checked == true)
    {
        rbl.SelectedValue = "N/A";
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I know there's a lot of other questions out there that deal with this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.