I have a Silverlight UI that includes a TabControl (Microsoft tab control) with several pages, and on one of the pages sits a grid. Data is bound to the grid dynamically during the course of the application using a call to grid.ItemsSource. It seems that the data binding only resolves if the tab page holding the grid is visible (is the selected tab page). Could this be true? If the grid is visible, I am able to see all of the metadta for the grid's data (columns, etc.); however, if the grid is not visible, none of the data & metadata is available.
I am also experiencing other 'strange' behaviors in IG controls (such as the XamTree control) on other pages of the tab control when switching between pages. Is there something that developers need to be aware of when hosting IG controls on pages of a TabControl?
(Note: I am using Infragistics 2010.2.)
Hi,
The XamGrid doesn't load its data, until its Loaded, which means its been added to the VisualTree.
I haven't tried it out just yet, but i believe the TabControl only adds items to the VisualTree when a tab is selected, which is why the XamGrid wouldn't have loaded its data yet.
As for the XamTree, what kind of issues are you running into?
-SteveZ
...the TabControl only adds items to the VisualTree when a tab is selected, which is why the XamGrid wouldn't have loaded its data yet.
OK, I guess that why I experienced the issue with the grid not having loaded its data. Thanks for that.
Re: XamTree. Here's the scenario:
1) XamTree is hosted on a tab page and is loaded with a single top-level node and child nodes.
2) Under user control, select and remove all nodes, including top-level node. (The info for the nodes is moved to a 'selected' list which is displayed in a XamGrid.)
3) Select a different tab page.
4) Go back to (select) tab page that holds XamTree.
5) Attempt to add a node into XamTree that was originally there, but is no longer in the tree (can see in debugger that tree has no nodes), and an exception is thrown indicating that the node key already exists in the tree. I can perform this 'remove node' and 'add node' operation without problems as long as I remain on that tab page, but as soon as a move from the tab page and back to the tab page, then the exception occurs.
It's baffling...
As I mentioned in earlier post for this thread, I have moved away from using a Tab Control in favor of multiple Expander controls. The problem with the XamTree doesn't occur under my new UI scenario. However, it appears that the XamGrid also doesn't load its data until the Expander is visible (much like the scenario with the TabControl tab page Visual Tree).