Harsh Jani

Harsh Jani

  • NA
  • 34
  • 53.7k

Displaying GridView on Index change event of dropdownlist

Dec 11 2014 3:21 AM
Hi,
 
I want to display GridView on SelectedIndexChanged event of DropDownList. I have set the AutoPostBack property of DropDownList to true. Now, the problem is every time a user changes the value in DropDownList, the GridView does not appear because the page gets posted back to the server and the index is lost. So, I have taken the value of Index into View State and the problem is solved. But, I have not placed the code inside if(!IsPostBack).
 
Now the problem is, every time the user clicks on Edit button inside GridView, the GridView disappears and the user has to select the value inside the DropDownList again to make GridView appear. Another, issue is that the GridView does not fire any event after he clicks update button.
 
Kindly help me rectify this issue. 
 
 

Answers (2)