468,783 Members | 1,645 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,783 developers. It's quick & easy.

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

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
Nov 17 '05 #1
0 1065

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

39 posts views Thread by TonyJeffs | last post: by
134 posts views Thread by James A. Donald | last post: by
388 posts views Thread by maniac | last post: by
48 posts views Thread by mahurshi | last post: by
18 posts views Thread by zoilus | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.