Hello,
i use Version 11.1 with CLR 4.0 in VS2010 Prof. The WebExploreBar (WEB) is bound to a WebHierarchicalDataSource (WHS). The data for WHS comes from a SqlDataSource (SDS) with a stored proc (SP) in backround. The Hierarchie is build via a foreign key column (FK_Parent) inside the SP. So i construct a self referencing structure, like a tree, and i want only the leafs to navigate to an Url.
Normaly i bound the SDS to the WHS and set the relation. Then i bound the WHS-ID as DataSourceID of the WEB and the ExplorerBarItemBinding to the View of the WHS.
This works fine, if there are only flat hierarchies of 2 levels. But if there are more nested levels, what is the best way to handle this?
Should i duplicate the possible Levels in the WHS and add an extra Item binding in the WEB?
Or should i catch the click on client-side and look for the level and possible childs?
Thank's for reply
Patric
Hello Patric,
Thank you for posting in our forums.
If you have more than one level you should add another ExplorerBarItemBinding object to the collection:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=WebExplorerBar_Binding_to_WebHierarchcialDataSource.html
You can use also LoadOnDemand if you want to increase the performance:
http://samples.infragistics.local/aspnet/Samples/WebExplorerBar/Performance/LoadOnDemand/Default.aspx?cn=explorer-bar&sid=746d1c57-ccc0-427f-b5c8-9db5d4f3c8ad
Let me know if you have further questions.
Hello Tsevtelina,
since i use a self reference in the table and at compile time number of levels is not fixed; adding additional ExplorerBarItemBinding to the collection is not the solution (or should i generate the different Bindings in code, depending of the levels?).
I helped me with a trick, i set the 'NavigateUrlField' of ParentItems to Null, so if i select a parent, it expand, showing the child nodes.
This works like a tree, what i was looking for. But is there a way to set the layout of the items collection like a tree control (with a + sign if the item has children and is colapsed an a - sign if it is expanded and no sign if it is a leaf)?
thank's
Hello Patric ,
Thank you for the update.
If you want to have the layout of the WebDatTree control and using manual load on demand ( not knowing the levels ) I recommend you choosing the WebDataTree controls
http://samples.infragistics.local/aspnet/Samples/WebDataTree/Performance/ManualLoadOnDemand/Default.aspx?cn=data-tree&sid=c257cd9c-1c5a-4159-aa51-ff8ea8386395
If you want to show +/- images of the ExplorerBarItems you should set the ImageUrl property
http://samples.infragistics.local/aspnet/Samples/WebExplorerBar/Style/MSOutlook2007/Default.aspx?cn=explorer-bar&sid=149ef335-0e56-4617-9264-51e9a947331d
But you should also change the HoverCssClass of the ExplorerBarGroup if you want different behavior there.
Please let me know if you need further assistance regarding this
Hello Tsvevtelina,
sorry for the time delay, had much to do.
To use the WebDataTree is not the solution, since i want to use the expanding and colabsing panels of the ExplorerBar, but inside each Panel i need the layout of a tree. By writing these lines, i got an idea. I use one Datasource to select all root levels of my hierarchical structure to generate the 'Group Items' of the ExplorerBar, then i add a WebDataTree to each Group and bind it to a second Datasource.
Do you think this is possible and on what event must i add the WebDataTree to the Groups Item Collection??
Thank's
Hello Patrick.
The idea should be possible using templates in order to have custom content in ExplorerBarItem
You can add WebDataTree inside the template and handle ItemClick event on the server. If the item is ExplorerBarGroup, you can access its item and after finding the template you can get the WebDataTree and set appropriate DataSource
http://community.infragistics.com/forums/p/42856/236368.aspx#236368
Please let me know if you have further questions