Last post Jan 30, 2013 09:06 PM by Decker Dong - MSFT
Jan 29, 2013 06:13 PM|megnin|LINK
I have a Gridview who's DataSource comes from TableA. It has a DropDownList column who's DataSource is TableB.
I'm trying to populate the TextBoxes in the column next to the DropDownList with the COUNT(priKey) FROM TableA WHERE priKey=DropDownList.SelectedValue.
I hope that makes sense.
The page also needs to load up with the Selected Value of the DropDownList matching the value in the database if there is one.
I have most of the GridView and SQL queries done and I can select a value from the DDL and the TextBox *on that row* will populate with the correct COUNT value, but I need all the rows to display the counts not just the current row.
Jan 30, 2013 09:06 PM|Decker Dong - MSFT|LINK
Do you mean you wanna Edit using Dropdownlist?
If yes, you can refer this sample:
PS: You must make sure that your Dropdownlist's elements (the selectedvalue) MUST BE one of the elements bound to the specific column value of your datatable. Otherwises there's error occuring.