This is a migrated thread and some comments may be shown as answers.

Data in the stackpanel is duplicated on Tab changed

1 Answer 28 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Rocky Fernandes
Top achievements
Rank 1
Rocky Fernandes asked on 24 Jul 2009, 05:03 PM

Posted 13 minutes ago (permalink)

I have some stackpanel within RadTabControl. Let me give an overview of one such stack panel.
  
<telerikNavigation:RadTabControl x:Name="tabControl" Height="Auto" Background="Transparent" Margin="0,0,0,10" BorderThickness="0">

<telerikNavigation:RadTabItem Header ="Technical">
<StackPanel x:Name="AssociateReportsPanel" Orientation="Vertical" Margin="0,5,0,0"/>
 </telerikNavigation:RadTabItem>

 

In code behind.. On Page load, I call a webservice and then on even completed I populate the stackpanel with a control as follows.

AssociatedReportsCustomListControl = new CustomListControl("Associated Reports", e.ScorecardMeasure.AssociatedReports);  
AssociateReportsPanel.Children.Add(AssociatedReportsCustomListControl);

Every time I change the Tab and then come back, the control within stackpanel is added again. How can I overcome this issue

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 27 Jul 2009, 07:11 AM
Hi Rocky Fernandes,

The Loaded event fires whenever an object is added to the Visual Tree and indeed this is different than the general perception of "loaded". What you can do is flag the web service call and the loading so that it will happen just the first time the loaded is fired.

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TabControl
Asked by
Rocky Fernandes
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or