Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataGrid deleting wrong row
Message
De
23/11/2004 14:23:23
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
DataGrid deleting wrong row
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00963985
Message ID:
00963985
Vues:
36
I will do this in point form to simplify the problem.

1. I have a dcgDataGrid derived from mmDataGrid on a UserControl within a WebTab.
2. The dcgDataGrid can successfully add, change and delete records with only a singe problem.
3. The dcgDataGrid is set up to do Paging (7 items per page)
4. The data in the grid is simple (Edit Button, Priority, Code, Description, Delete Button)
a. In Priority order
5. When pressing the Edit Button, the user can change only the value in the Priority field e.g 1 to 9999 (no duplicates except for 9999)
6. When pressing the Delete Button, the user is prompted to make sure the user wants to delete the record.
a.This is part of dcgDataGrid versus mmDataGrid.


Steps to reproduce the problem:

1. Add enough records to extend to the second page.
2. Edit the priority fields on the first page as follows (1, 2, 3, 4, 7, 10, 15)
3. Exit and come back in to make sure you are working with it as if it was fresh data.
4. Edit the Priority = 15 and set it to 5 (Notice how it should now become the 5th item in the list; Row[4])
5. Press the update button and notice how the DataGrid does not show the new order of the rows. (Refresh???)
6. Press the Delete button in the row with the Priority = 7
a. Now notice how Priority = 5 has been deleted.
7. The delete is relative as well, for example if you deleted Priority = 10, then Priority 7 would be deleted.


As in the above example “1, 2, 3, 4, 7, 10, 5” when pressing on the Delete button next to the “7” (visual Grid reference of Row[4]), the “5” record is deleted (Session variable reference of Row[4]).

I have attemped to load the session variable after saving the priority field, then reassigning it to the business object. At the very end of the UpdateCommand I even tried rebinding the control twice in sequence. The grid will still show the incorrect order of the rows.

Any ideas?
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Répondre
Fil
Voir

Click here to load this message in the networking platform