Click here to Skip to main content
15,880,364 members
Please Sign up or sign in to vote.
0.00/5 (No 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
Updated 21-Dec-10 6:59am
v2
Comments
Brij 21-Dec-10 12:59pm    
did formating

You have to maintain the selected value somewhere and show the selected item once again loaded.
Have a look to the following article. It'll help you
Maintaining States of Selected CheckBoxes in Different Pages inside the GridView
 
Share this answer
 
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
Sure you put the dropdown populating code in page IsPostback property. Make sure it is not getting repopulated on every page postback.
 
Share this answer
 
This is bit tricky logic.

Every time you move from 1 page to other, the data will get loaded freshly.

Option 1

Save the selected value data of DDL on every page navigation in to the DB.
Onbind you check the saved value and change the selected index of the DDL.

Option 2

Store the selected value in some temporary place and re-use(But home values you can save? If the pages more?)
VB
Please ref Brij Ans
 
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