Hi Maria Im,
I prepared a project for you to illustrate the common use of LoadOndemand
feature is used when you expand a RadTreeViewItem
and you want to add new Items ( business items or RadTreeViewitems
) right after the node is expanded. When you add new Items via other methods ( for example Button`s Click handler) and you wish to view the changes in the visual tree you have to use the ExpandItemByPath
Method. Using LOD
or not, UI Virtualization
or not, the visual containers (RadTreeViewItems
) are generated only when they are needed. When the tree loads, only the root level is generated and ItemPrepared
fires for every item in the root level. Then ItemPrepared
fires when you expand an item that has children or when you add an item to a level that is already revealed.
In the attached solution you can use the LOD
feature by expanding an item via mouse click and you can programmatically add an item to the SelectedItem of the tree( if exist). Note that the LOD
feature is stopped before and started after the ExpandItemByPath method.
Hope this helped you. Feel free to ask if you need more info.
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>