Asp net gridview rowupdating dropdownlist
The following throws and Argument Out of Range exception.
You have to check when its in update mode, you need to get selected item value of dropdown list and use that value as parameter for update statements.When you are dynamically creating controls, you have to recreate them on every postback. Value); I have an error: "Input string was in incorrect format" because "total_column_drop_down_list. Now you can ask questions directly to me on my new site ASPForums. So be sure to check any other locations you may be binding anywhere in your code. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Without seeing your code it will be hard to give you an exact answer, but I can at least give you some tips to steer you in the correct direction. Once you have your grid setup you will need to hook into two of the Grid View events: Row Data Bound and Row Updating to be able to fill the dropdown with the correct value when you change to edit more and to send the updated value of the table.
NET 4 General Discussion section of the Wrox Programmer to Programmer discussions.
In the meantime, I'll paraphrase for other readers: You need to check for postback (see comments above).
Edit: @Tim Schmelter should add his comment as an anwer.
Sql Client; public partial class _Default : System.
Open() Dim cmd As New Sql Command("Select * from stores", con) Dim da As New Sql Data Adapter(cmd) Dim ds As New Data Set() da.
I've read that it might be possible to use the On Selected Index Changed event for the Drop Down List and store the value in View State, but I've been having difficulty with that as well.