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

Update Database from codebehind

3 Answers 61 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 14 Oct 2010, 04:29 PM
Hi.

Do you have any examples on how to update the database from the CodeBehind when a user drags and item to another listbox?

I don't want to use any SQL or Object datasource, I would like to do it all from the CodeBehind?

Many thanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Oct 2010, 06:15 AM
Hello Karl,


I hope you can perform the code in "Dropped" event of RadListBox. The Dropped event fires after the Dropping event (if not cancelled). Attach the Dropped event and add your code to update db in the handler.



-Shinu.
0
Karl
Top achievements
Rank 1
answered on 15 Oct 2010, 09:16 AM
Thanks, that works if I drag and drop over another control but not if I drag to the RadListbox itself, what even gets fired then?

Thanks
0
Yana
Telerik team
answered on 19 Oct 2010, 12:32 PM
Hi Karl,

In this case you should subscribe to OnReordered event of the listbox. Also note that AutoPostBackOnReorder property should be set to "true".

Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ListBox
Asked by
Karl
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Karl
Top achievements
Rank 1
Yana
Telerik team
Share this question
or