Click here to Skip to main content
15,907,492 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi,

I am using drop down lists in grid view.

I have predefined data in ddl. I am using pagination.

I am in first page. I have some data in ddl. I changed data in ddl and going to second page. If I come back to first page from 2nd page, it is not retaining changed values. It is getting default values.

I want to retain the values after coming back to first page from second page.

It would be great if u can help me out in this regard.

Thank you so much in advance.
Posted

Don't predefine the data in the designer, fill it during Page_Load and wrap the filling in a
if(!IsPostBack)
{
<fill the ddl here>
}


Make sure EnableViewState is true for the ddl.

That should maintain any changes you make (during this session).
 
Share this answer
 
v2
Comments
yogeshkollu 1-Mar-11 13:10pm    
thank you.
but i am showing my grid view on button click and not on page load
Your question is word-for-word the same as one asked back in December 2010. That question was marked as solved, so I suggest that you refer to that question.

Original (Solved) question.[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900