copying value of DDL in a Datagrid "pre-edit command" to value in "post edit command"

Discussion in 'ASP .Net' started by San Diego Guy, Aug 7, 2003.

  1. Hi all!
    I have Datagrid.
    Within that datagrid I have a drop down list that I set up some values in (a
    "collection")

    I set up an edit command column on the datagrid and wrote simple code to get
    me in to edit mode:
    sub dgEdit(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
    dgStatus.EditItemIndex = e.Item.ItemIndex
    bindData() 'This is just a sub I wrote to re-bind the data
    end sub

    So, when I click edit in the datagrid, it goes in to edit mode... but the
    value that was displayed where the drop down list gets put in does not show
    up, it shows the first item in the ddl 'collection'.

    I figured that I had to grab the value of that control before the edit so I
    added the following in to the above sub:
    dim ddlStatus as DropDownList
    ddlStatus = e.Item.FindControl("ddlStatus")

    Now I figure I can probably access that value with something like:
    ddlStatus.SelectedItem.Text

    Problem is, how do I them put that in to the selected text for the
    "post-edit" drop down list?

    I hope this makes sense, if not please post and I'll try to give more
    information.
    Thanks all!
    Steve
    San Diego Guy, Aug 7, 2003
    #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. Shane O. Pinnell

    Databound DDL in Datagrid using code-behind

    Shane O. Pinnell, Jul 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    Shane O. Pinnell
    Jul 10, 2003
  2. Marina
    Replies:
    0
    Views:
    910
    Marina
    Aug 12, 2003
  3. steve roszko
    Replies:
    1
    Views:
    1,838
    steve
    Aug 12, 2003
  4. Vik
    Replies:
    4
    Views:
    1,934
  5. Replies:
    2
    Views:
    476
Loading...

Share This Page