开发者

Update Entity Data Model After Tree Drag and Drop

I have a Dev-express Tree Structure with Drag and Drop capability. After Drag and Drop there is always a new structure of my database because change in the Tree structure. I want to update by database as soon as I apply Drag and Drop in开发者_如何学运维side my Tree.

Thanks.


When you applying drop event, handle it right way and that is. It will look like this:

public void TreeView_Droped (object sender, RoutedEventArgs e)
{
    //Do some work
    UpdateMyDataSource(sender, e, [another_fields_you_need]);
}

In UpdateMyDataSource() you have to invoke your own logic to update database entity[ies] (connect to database, blah blah blah, etc.). You can retrive object you need using your own casting on sender or e objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜