TMHPROG
asked on
Changeing the order of records in a bound datagrid using Up/Down buttons
My users would like to reorder the records in a bound datagrid by using Up/Down buttons. The DG also manages additions/deletetions of records. I have tried adding a field in the table to hold the SortOrderValue. When moving a record up or down I can increase/decrease the SortOrderValue by 1 and rewrite the record to the database, but how do I change the SortOrderValue of the "other" record that is being reordered? I guess what I'm asking is after updating the SortOrderValue for the selected record, how do I determine which other record will be affected so I can correct its SortOrderValue.
Thanks in advance,
Scott
Thanks in advance,
Scott
Use a CurrencyManger to loop through all records next to the record you change and set previous order value + 1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.