Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a Gridview where there are two columns, One is ID(Label Control) and another is Sort Order(Dropdownlist Control).The dropdown list have the populated data from 1 to the max no of rows in the gridview .Like:

ID Sort Order
001 1
002 2
003 3
004 4
Now if I change the selection from the dropdown list.E.g. I change the sort order of ID 002 from 2 to 3 then the sort order will change and gridview will look like:

ID Sort Order
001 1
003 2
002 3
004 4

I need the sort order logic to manupulate this within dropdownlist_selectedindexchanged event.Also update the database with the value.

Thanks & Regards
Posted
Comments
Joezer BH 14-Feb-13 6:54am    
Can you show some code, so that we'll understand better?

1 solution

So, what is the issue?

Based on grid's dropdown value, set the sort order of that rows defined ID. You would need to readjust the sort order of all the followup records accordingly in a for loop. Once done, save the same in DB. What you seek is just to readjust a field value based on selection and persist it.

Try out. Post specific issue if you face.
 
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