This is a migrated thread and some comments may be shown as answers.

Binding to collections - serious problems

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vjeran
Top achievements
Rank 2
Vjeran asked on 27 Aug 2008, 03:34 PM
Hi,
i am trying to make an wizard control that first gathers all data, and after that it will save all data to db.

I have simple entity that has Id, Key,Value. I'd put entities into the list<type> collection. Id fields are empty because entities and collection exists in the session and they are not saved yet. DataKeyNames is set to Key.

Now.. It is binded as datasource. When i put an code to delete items i have some problems. Grid is using sorting and paging (not SQL).

1. It looks like it is working until u add some sorting capabilities. When u add sorting  number that u get as e.Item.DataSetIndex is not the one that corresponds to one that is index in the real collection. I couldn't find any way to get correct index. In product documentaion i read that it works only when datatable is binded.
2. I wonder how does it work when i am using objectdatasource with custom paging, or any objectdatasource? Will sorting work in this case, or i must use dataset?


2 Answers, 1 is accepted

Sort by
0
Vjeran
Top achievements
Rank 2
answered on 27 Aug 2008, 05:47 PM
When i populate grid using DataTable instead collection, in same scenario, same thing happens.
Wrong DataSetIndex is returned.

0
Nikolay Rusev
Telerik team
answered on 29 Aug 2008, 02:35 PM
Hello Vjeran Ivičić,

Unfortunately the information provided is not sufficient to determine what is wrong. Can you provide us with more details such as how do you build this wizard control or is it ajaxified?

Additionally, can you share with us the code on which you are working? Thus we will be able to help you further.

Best regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Vjeran
Top achievements
Rank 2
Answers by
Vjeran
Top achievements
Rank 2
Nikolay Rusev
Telerik team
Share this question
or