Click here to Skip to main content
16,021,172 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have 3 columns in gridview like as below:

ProductID ProductName Order
44 Lux 1
56 Dove 2
69 Pears 3
78 Hamam 4
84 Power 5
----------------------------
Dropdownlist loads the Productname
2 textbox:
1. txtOldOrder
2. txtNewOrder
when i select the productname : Pears in dropdownlist it shows txtOldOrder=3......
when i give value as 2 in txtNewOrder that gridview should rearrange like as below :

ProductID ProductName Order
44 Lux 1
69 Pears 2
56 Dove 3
78 Hamam 4
84 Power 5

Very Urgent Please reply quickly
Posted
Updated 23-Oct-13 11:11am
v4
Comments
[no name] 23-Oct-13 16:36pm    
It's not urgent to anyone here. And you need to show some of the code you have written if you want a sensible answer.
Sergey Alexandrovich Kryukov 23-Oct-13 17:12pm    

1 solution

Since non of these tables has a serial number, it's pretty much impossible to answer your question.

You're also going to have to explain what you mean by "rearrange sort order".
 
Share this answer
 
Comments
Nagaraj Bobba 26-Oct-13 2:56am    
TestOrder is the serial no
Nagaraj Bobba 26-Oct-13 3:15am    
i mean in that table having Order column that column is serialno column
Dave Kreskowiak 26-Oct-13 10:07am    
Order does not mean "Serial Number". Name your columns what they describe. If this column is used specifically for a sort order, name the column "SortOrdinal".

So you want to change the order in which the items are sorted? You're going to have to load the table into a DataTable object in your code, reassign the sort ordinal numbers and then write the table back to the database.

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