Re: How to capture SelectedIndexchanged event of dropdownlist in Datagrid

Discussion in 'ASP .Net' started by Arthur Dent, Dec 23, 2004.

  1. Arthur Dent

    Arthur Dent Guest

    This is what i would do... (little roundabout, but it works)

    1. put a drop down on the form normally
    2. dblclick it and get the codebehind function generated
    3. rename the handler function something appropriate (eg.
    GridLst_SelectedIndexChanged)
    3. change the handler to be Protected instead of Private
    4. delete the temporary drop down (but Not the handler)
    5. go to the HTML view of your aspx page, and find your drop down list
    6. add an attribute to the list as follows, using your handler function
    name:
    onchange="GrdLst_SelectedIndexChanged"

    That should do it for you. The handler function will not be called right
    away, until something else causes the form to postback. If you want it to
    fire immediately on change, set AutoPostBack = True.

    HTH.
    CheerZ.

    "Uma Shanmugam via .NET 247" <> wrote in message
    news:...
    (Type your message here)

    --------------------------------
    From: Uma Shanmugam

    Everyone,
    I have a datagrid and it has a dropdownlist in the Edit mode.I want to
    capture the selectedIndexChanged event of the dropdownlist. I tried
    ItemCommand event and then realised that it is fired when a button is
    clicked.Any help will be greatly appreciated.

    Thanks in Advance
    Uma Shanmugam

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>LxFjJ2mX9kSY0YuzKKv4cQ==</Id>
     
    Arthur Dent, Dec 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shiva
    Replies:
    3
    Views:
    32,134
    leoykl
    Jun 14, 2012
  2. Shiva
    Replies:
    0
    Views:
    449
    Shiva
    Nov 17, 2004
  3. The Colonel
    Replies:
    0
    Views:
    574
    The Colonel
    Jan 24, 2005
  4. The Colonel
    Replies:
    0
    Views:
    520
    The Colonel
    Jan 24, 2005
  5. The Colonel
    Replies:
    0
    Views:
    516
    The Colonel
    Jan 24, 2005
Loading...

Share This Page