I've been wrestling for a while trying to databind to 2 tables essentially. Custom collections that inherit from IBindingLists, but the core type of collection is not really the problem. I can succesfully bind as long as i only bind one table or collection. Things get tricky when I try to programmatically bind to the next table.
To help understand my problem I am attaching a database diagram of the tables in question.
How can I use databindings to populate data coming from that type of relations, a self-referencing table and a link-table.
I read almost everything available in the forums and online, and found nice text, but no concrete example close to this scenario.
My treeView is not using declarative datasources, I am using the OnDatabinding event to populate the grid:
And in the NodeDataBound event I actually use custome attributes to hold all the data I need.
My problem comes when i want to hook up the UserInRegion collection of record to the Region Collection.
Thank you in advance,
Jean
To help understand my problem I am attaching a database diagram of the tables in question.
How can I use databindings to populate data coming from that type of relations, a self-referencing table and a link-table.
I read almost everything available in the forums and online, and found nice text, but no concrete example close to this scenario.
My treeView is not using declarative datasources, I am using the OnDatabinding event to populate the grid:
<telerik:RadTreeView runat="server" ID="RadTreeView1" EnableDragAndDrop="True" OnClientMouseOver="onTreeViewMouseOver" |
OnClientMouseOut="onTreeViewMouseOut" OnClientContextMenuItemClicking="onClientContextMenuItemClicking" |
OnClientNodeDragStart="onTreeViewDragStart" OnDataBinding="RadTreeView1_DataBinding" |
OnClientNodeDropping="onTreeViewDropping" OnClientContextMenuShowing="onClientContextMenuShowing" |
OnNodeDrop="RadTreeView1_NodeDrop" OnNodeDataBound="RadTreeView1_NodeDataBound" |
OnClientNodeDragging="onTreeViewDragging" OnNodeEdit="RadTreeView1_NodeEdit" |
oncontextmenuitemclick="RadTreeView1_ContextClick" |
AppendDataBoundItems="True"> |
<ContextMenus> |
<telerik:RadTreeViewContextMenu ID="MainContextMenu" OnDataBinding="MainContextMenu_DataBinding" runat="server"> |
<Items> |
<telerik:RadMenuItem Value="Rename" Text="Rename ..." Enabled="false" ImageUrl="~/Images/rename.gif" PostBack="false"></telerik:RadMenuItem> |
<telerik:RadMenuItem Value="NewRootUnit" Text="New ..." ImageUrl="~/Images/newfolder.gif"></telerik:RadMenuItem> |
<telerik:RadMenuItem Value="Delete" Text="Delete ..." ImageUrl="~/Images/deletefolder.gif"></telerik:RadMenuItem> |
<telerik:RadMenuItem IsSeparator="true"></telerik:RadMenuItem> |
<telerik:RadMenuItem Value="SetAsDefault" Text="Set as default ..." ImageUrl="~/Images/default.png"></telerik:RadMenuItem> |
</Items> |
<CollapseAnimation Type="InCubic" /> |
</telerik:RadTreeViewContextMenu> |
</ContextMenus> |
</telerik:RadTreeView> |
And in the NodeDataBound event I actually use custome attributes to hold all the data I need.
My problem comes when i want to hook up the UserInRegion collection of record to the Region Collection.
Thank you in advance,
Jean