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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:46:21+00:00 2026-05-24T05:46:21+00:00

I have a Gridview in which one of the template fields has a radiobuttonlist

  • 0

I have a Gridview in which one of the template fields has a radiobuttonlist and a dropdownlist. How can I access the row that the radiobuttonlist is in on the SelectedIndexChanged event, so I don’t end up updating all of the dropdownlist inside the that template field of the gridview. I don’t have any code currently but any help would be greatly appreciated

  • 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-05-24T05:46:22+00:00Added an answer on May 24, 2026 at 5:46 am
    <asp:TemplateField HeaderText="Column with ListControls" >
        <ItemTemplate>
             <asp:DropDownList ID="DropdownList1" OnSelectedIndexChanged="SomethingChanged" AutoPostBack="true" runat="server" >
                 <asp:ListItem Text="1"></asp:ListItem>
                 <asp:ListItem Text="2"></asp:ListItem>
             </asp:DropDownList>
             <asp:RadioButtonList ID="RadioButtonList1" OnSelectedIndexChanged="SomethingChanged" AutoPostBack="true" runat="server">
                 <asp:ListItem Text="1"></asp:ListItem>
                 <asp:ListItem Text="2"></asp:ListItem>
             </asp:RadioButtonList> 
        </ItemTemplate>
    </asp:TemplateField>
    

    Codebehind VB.NET:

    Protected Sub SomethingChanged(ByVal sender As Object, ByVal e As EventArgs)
       'in this example this handler is used for both, Dropdownlist and RadiobuttonList'
        Dim listControl = DirectCast(sender, ListControl)
        Dim row = DirectCast(listControl.NamingContainer, GridViewRow)
        Dim item = listControl.SelectedItem
        'with FindControl on the row you could also find controls in other columns...' 
    End Sub
    

    C#:

    protected void SomethingChanged(object sender, EventArgs e)
    {
        //in this example this handler is used for both, Dropdownlist and RadiobuttonList
        var listControl = (ListControl)sender;
        var row = (GridViewRow)listControl.NamingContainer;
        var item = listControl.SelectedItem;
        //with FindControl on the row you could also find controls in other columns...
    }
    
    • 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 has a template field containing a checkbox as one
I have a GridView in which each row has a custom view. The grid
For example, Lets say that I have a gridview column which has important controls,
I have Two Labels such as FixedTotal and TotalPercent, One GridView which has One
I have a gridview which can be filtered from one or more values in
I have two template fields in my data gridview. One template field is a
I have one GridView which has multiple columns. Here I just mentioned only the
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a GridView which is databound to an XML Datasource. For one of
I have a GridView to which I bind a dataTable that I manually created.

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.