Setting dropdownlist.selectedindex when entire datagrid is dynamic

Discussion in 'ASP .Net Web Controls' started by NancyA, Mar 25, 2005.

  1. NancyA

    NancyA Guest

    I have a dynamic datagrid that is created using records in a SQL table. The
    datagrid functions perfectly in both view and edit modes. The only thing
    left to do is to figure out how to set the SelectedIndex property of any
    DropDownLists in the grid to the correct value when the user clicks the Edit
    button so that they default to the current value from the record. I would
    appreciate any help!
     
    NancyA, Mar 25, 2005
    #1
    1. Advertising

  2. NancyA

    JV Guest

    I think you're going to need to put code into the DataGrid's ItemDataBound
    event for this. You can find samples of using this event in the DataGrid
    online help.

    "NancyA" <> wrote in message
    news:...
    >I have a dynamic datagrid that is created using records in a SQL table.
    >The
    > datagrid functions perfectly in both view and edit modes. The only thing
    > left to do is to figure out how to set the SelectedIndex property of any
    > DropDownLists in the grid to the correct value when the user clicks the
    > Edit
    > button so that they default to the current value from the record. I would
    > appreciate any help!
     
    JV, Mar 25, 2005
    #2
    1. Advertising

  3. NancyA

    NancyA Guest

    Re: Setting dropdownlist.selectedindex when entire datagrid is dyn

    JV - Thanks for the suggestion, but that won't do it as the fields don't seem
    to be accessible since they are dynamic. Any other good suggestions out
    there?

    "JV" wrote:

    > I think you're going to need to put code into the DataGrid's ItemDataBound
    > event for this. You can find samples of using this event in the DataGrid
    > online help.
    >
    > "NancyA" <> wrote in message
    > news:...
    > >I have a dynamic datagrid that is created using records in a SQL table.
    > >The
    > > datagrid functions perfectly in both view and edit modes. The only thing
    > > left to do is to figure out how to set the SelectedIndex property of any
    > > DropDownLists in the grid to the correct value when the user clicks the
    > > Edit
    > > button so that they default to the current value from the record. I would
    > > appreciate any help!

    >
    >
    >
     
    NancyA, Mar 28, 2005
    #3
    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. K Bryan
    Replies:
    4
    Views:
    2,457
    Andrew de la Harpe
    Apr 15, 2004
  2. David Austin via .NET 247
    Replies:
    2
    Views:
    561
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  3. keithb
    Replies:
    1
    Views:
    12,011
    shauns1
    Nov 1, 2006
  4. Jason Wilson
    Replies:
    1
    Views:
    13,287
    Ken Cox [Microsoft MVP]
    Sep 14, 2006
  5. S_K
    Replies:
    5
    Views:
    771
    Eliyahu Goldin
    Nov 14, 2007
Loading...

Share This Page