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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:50:20+00:00 2026-05-30T05:50:20+00:00

I have a simple datalist with a dropdownlist and a textbox. When the dropdownlist

  • 0

I have a simple datalist with a dropdownlist and a textbox.

When the dropdownlist selected index changes, I want to load a value into the textbox in that listbox item (i.e., the textbox on that particular row).

<ItemTemplate>
    <asp:DropDownList runat="server" 
        ID="ddlCategory" AutoPostBack="true"
        DataTextField="category"
        DataValueField="category_code" 
        OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged" />                      
    <br />
    Code<asp:TextBox 
        runat="server" 
        ID="txtOutputCode" 
        Text='<%# Bind("output_code") %>' />
</ItemTemplate>

How do I do this?

The challenge I’m facing is how to find the corresponding textbox to update.

E.g. for a button I’d pass a commandname, and command arguments. And then I’d handle the event in the gridview or datalist to find the corresponding textbox and update the text. What can we do in case of a selectedindex change of a dropdownlist?

  • 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-30T05:50:21+00:00Added an answer on May 30, 2026 at 5:50 am

    I guess this should work. Try this…

    protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
    {
       var ddlList= (DropDownList)sender;
       var row = (GridViewRow)ddlList.NamingContainer;
       //get the Id of the row
       var Id = Convert.ToInt32(((Label)row.FindControl("IdColumn")).Text);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple win service, that executes few tasks periodically. How should I pass
I have simple SSIS package which reads data from flat file and insert into
I have simple SSIS package where I import data from flat file into SQL
I have simple WinForms application where modifying Windows Registry. The problem is that in
Situation: I have a simple XML document that contains image information. I need to
I have simple button: <button type=button id=somebutton value=start>blah</button> in jQuery, on the bind('click, function(){....
Have simple C# console app which imports text data into SQL. It takes around
i have a simple example of a JList that is getting it's data from
Have simple Order - Item app. No cart. Need help with joined scopes for
I have a simple usercontrol, with a datalist, and checkboxes inside. <asp:DataList ID=DataListDroits runat=server

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.