I have a Details View with a Drop Down List in an Edit Item Template, I know, pretty cool right?But when I try to Update the table with a new value from the Drop Down List the table does not get updated with the new value.To create buttons that perform the built-in cancel and update operations, add a button control to the template.
you can use a label if you wish in the item table but that would require a bit more work as the username is not part of the gridview.
If you have control of the gridview sql and can add the username to the dataset (say as User Name) then you could bind an Item Template label to the User Name and the Edit Item Template Drop Down List to the User_ID EDIT: Expanded Example: So, Going with the Label idea the template would look something like this: Select Loan_ID , l.
I tried to search for solutions, but couldn't find any.
Everywhere they are talking about Gridview within Update Panel.
To specify the custom template declaratively, add an Edit Item Template element inside the List View control.
Then add the contents and controls for template to the Edit Item Template element.
For more information, see Script Exploits Overview.
My problem is when I put a dropdownlist in the edititemtemplate such as below it does not update my table and I get the below error I want to be able to update my loans table with the appropriate info: EDIT: I know that it's probably because the Data Value Field for the Drop Down List isn't set to the corresponding ID# in the table, but when I change the Data Value Field, it gives me a bunch of errors. My Update Command: Update Command="UPDATE [Loans] SET [Date_Loaned] = @Date_Loaned, [Date_Returned] = @Date_Returned, [Sign_Off] = @Sign_Off, [Laptop_ID] = @Laptop_ID, [User_ID] = @User_ID, [Dept_ID] = @Dept_ID, [Location_ID] = @Location_ID WHERE [Loan_ID] = @original_Loan_ID", disabled in one and enabled in the other.
protected void get_selected_vals_Click(object sender, Event Args e) private void Bind Grid() protected void ele_display_grid_Row Editing(object sender, Grid View Edit Event Args e) protected void ele_display_grid_Row Updating(object sender, Grid View Update Event Args e) I am getting edit link but I cant click it.. I was placing the gridview over an image, problem was with the z-index. Edit Index to Grid View Row Index On Row Canceling Edit //for setting Grid View.
I changed the z-index of background image to 0 and it all worked.. Edit Index back to -1 On Row Updating //for updating record and setting Grid View.
I have used an update panel elsewhere on that page, but outside the gridview, and it is working fine. I thought triggers were supposed to be outside the Update Panel. It was causing error and not recognizing the Event Name I provided, even though it was correct.