Does "DropDownList" support the "CommandName" event?

Discussion in 'ASP .Net' started by dvanderwel, Feb 7, 2008.

  1. dvanderwel

    dvanderwel Guest

    I have a .NET 1.1 web page with a DataGrid containing a TemplateColumn
    that contains a DropDownList.

    I need to fire an event when the selected item in the DropDownList
    changes for the current DataGrid row, and I'm having trouble figuring
    out how to do this.

    Other control types I have defined the "CommandName" property in the
    aspx file. The event returns the index of the row that contains the
    control, and I can thus pull more data out of the row.

    In the case of the DropDownList, the CommandName property is not
    available, and I can't figure out how to determine the index of the
    DataGridRow that the DropDownList control lives in.

    Does anyone know how I can go about doing this?
     
    dvanderwel, Feb 7, 2008
    #1
    1. Advertising

  2. Hi,

    You can access the DropDownList being changed by converting the "sender"
    argument of the event to a DropDownList. Then you may access the
    DataGridCell and DataGridRow using the dropdown's "Parent" element. Again,
    you will need to convert it to the corresponding type.



    --
    All the best,
    Coskun SUNALI
    MVP ASP/ASP.NET
    http://sunali.com
    http://www.propeople.dk

    "dvanderwel" <> wrote in message
    news:...
    >I have a .NET 1.1 web page with a DataGrid containing a TemplateColumn
    > that contains a DropDownList.
    >
    > I need to fire an event when the selected item in the DropDownList
    > changes for the current DataGrid row, and I'm having trouble figuring
    > out how to do this.
    >
    > Other control types I have defined the "CommandName" property in the
    > aspx file. The event returns the index of the row that contains the
    > control, and I can thus pull more data out of the row.
    >
    > In the case of the DropDownList, the CommandName property is not
    > available, and I can't figure out how to determine the index of the
    > DataGridRow that the DropDownList control lives in.
    >
    > Does anyone know how I can go about doing this?
     
    Coskun SUNALI [MVP], Feb 7, 2008
    #2
    1. Advertising

  3. dvanderwel

    dvanderwel Guest

    Cool thanks.

    I tried doing that I but I wasn't able to find the DataGridRow within
    the Parent element of the DropDownList.

    I will look into this again, perhaps I just missed something.

    Thanks for the advice.
     
    dvanderwel, Feb 7, 2008
    #3
  4. You are welcome.

    --
    All the best,
    Coskun SUNALI
    MVP ASP/ASP.NET
    http://sunali.com
    http://www.propeople.dk


    "dvanderwel" <> wrote in message
    news:...
    > Cool thanks.
    >
    > I tried doing that I but I wasn't able to find the DataGridRow within
    > the Parent element of the DropDownList.
    >
    > I will look into this again, perhaps I just missed something.
    >
    > Thanks for the advice.
     
    Coskun SUNALI [MVP], Feb 7, 2008
    #4
    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. John Blair

    asp:linkbutton - commandname behaviour

    John Blair, Dec 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,985
    John Blair
    Dec 30, 2004
  2. Irfi
    Replies:
    0
    Views:
    632
  3. Irfi
    Replies:
    0
    Views:
    442
  4. =?Utf-8?B?RGFiYmxlcg==?=

    use Formview cancel commandname to return to GridView Page?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 20, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    5,219
    =?Utf-8?B?RGFiYmxlcg==?=
    Mar 20, 2006
  5. =?Utf-8?B?Tkg=?=

    gridview and dropdownlist and commandName

    =?Utf-8?B?Tkg=?=, Nov 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    950
    =?Utf-8?B?Tkg=?=
    Nov 8, 2006
Loading...

Share This Page