ASP.NET: DropDownList rebinds DetailsView

Associate
Joined
20 Jan 2005
Posts
386
Location
Crewe, Cheshire
Hi folks,

I'm just wondering if anyone has come across the following.

On an aspx page I have a DetailsView, which I have modified to include DropDownLists and custom TextBoxes etc.
One of my DropDownLists is bound to the DetailsView, but I also have code on the SelectedIndexChanged on the DropDownList to perform simple code to hide/show rows on the DetailsView.
But when the page posts back to run through the code, it also rebinds all the data in the DetailsView resetting all the values again, so I have to select the value in the DropDownList a second time for it to work correctly.

I think this is due to the DropDownList value also being bound to the DetailsView, which is why it is rebinding the DetailsView again.

Has anyone come across this issue before, if so is there a fix.

Thanks
 
Back
Top Bottom