开发者

Data binding question

I have a database with 3 tables. One ta开发者_如何学运维ble is used for linking other two tables (many-to-many relation). I know how to use binding to bind some C# control to table, but now i don't know how to bind that "middle" table to some control and show data from both tables. So, if some row from table 1 is related to 4 rows from table 3, is there any way to show that in some control using simple binding?


This is an excellent time to use a 'view model'. Basically a view model is a 'middle layer' class that has some idea of the 'flow' of your application. This view model would expose three ObservableCollections and you would databind to these three collections.

It will be up to logic inside your view model class to relate the three collections to the underlying database tables.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜