|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi
I have a couple of questions regarding the client side operation of the Grid control:
1. Is there any way to add an item to the top of the grid? The addItem method always seems to add to the bottom.
2. Is there any way of accessing an item once it has been deleted? I have a situation where an item is deleted, and later on I whish to undelete it. I have the key of the item requiring undeletion, but cannot seem to access the item in order to determine its index required for the undeleteItem method.
3. Deleting an item that has been recently added seems to confuse the various server side collections on postback. Is this something that needs to be handled in a certain way?
Regards, Phil
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Currently there is no way to add item to the top of the grid, nor undeleting an item. We are seriously considering adding the undelete feature though. So hopefully we can have it in the near future.
We are not aware of any issues regarding deleting an item that has been recently added. Can you elaborate or provide a test page that demonstrates the problem?
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
What I am finding is the following:
I add an item and then delete it again on the client side On postback, I get an empty added collection (correct) but the deleted collection contains the item (incorrect)
I could provide code, but hopefully this is self explanitory.
Regarding undeleting an item, I have the 'undeleteItem' method available to me. However, I am having difficulty because this method requires an index, and I cannot determine the index as there is no way to access the deleted items. (e.g. If I know I have deleted item with key=a, and I have decided I would like to undelete it, I cannot do so because I cannote determine its index from the key).
Phil
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The behavior of DeletedItems collection is by design. The idea is AddedItems, DeletedItems and ChangedItems together should cover all changes made to the Grid. When you add a new item and then delete it, the Grid's Items collection grows by one so there will be a new item regardless. To be consistent the new item is marked as deleted.
I am not exactly sure what you mean about the undeleteItem. You can only undelete an item previously deleted by you, thus you should know the index right?
Thanks
|
|