Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > copying value of DDL in a Datagrid "pre-edit command" to value in "post edit command"

Thread Tools

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

San Diego Guy
Posts: n/a
Hi all!
I have Datagrid.
Within that datagrid I have a drop down list that I set up some values in (a

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:

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
Thanks all!

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Snapshot restraint - edit, edit, edit Patrick Digital Photography 0 05-06-2005 10:53 PM
Edit All Function for DataGrid, and Moving the Edit Function in a DataGrid Schultz ASP .Net 3 02-14-2005 04:47 AM
Adding DDL Edit Column from code behind problem. Sam Jenkins via .NET 247 ASP .Net Datagrid Control 0 08-06-2004 10:14 AM
Re: Persisting DDL.SelectedValue or DDL.SelectedItem.Value without Viewstate Marina ASP .Net 0 08-12-2003 07:08 PM