Hi,
I'm starting to pull my hair out trying to figure this out and everything I've tried doesn't seem to work.
I'm creating a website in Visual Studio 2005 with VB.NET which contains a GridView. The GridView is being populated by an SqlDataSource and has Edit and Delete buttons automatically generated.
I have converted some of the columns to ItemTemplates and replaced the TextBox in the EditItemTemplate with a DropDownList.When I click Edit, it changes to say Update and I am trying to perform some validation at this point.
The validation I want to perform is to check all the other rows in the GridView to make sure that the selection chosen in the DropDownList hasn't been selected on another row.
For example,
Row 1 DropDownList = Sick
Row 2 DropDownList = Holiday
Click Edit on Row 2 and change the DropDownList to be Sick and then click Update. I want a message to appear saying "Sick has already been selected" and then cancelling the Update before it happens but leaving the row in Edit mode.
I've searched everywhere and can't seem to find a way to find how to get the value of the DropDownList in Row 1 when I'm editing Row 2.
Can anyone help me please? :-(