Click here to Skip to main content
13,295,409 members (67,695 online)
Rate this:
 
Please Sign up or sign in to vote.
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 14-Feb-13 0:35am
Comments
Edo Tzumer 14-Feb-13 6:54am
   
Can you show some code, so that we'll understand better?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100