Data in the stackpanel is duplicated on Tab changed

2 posts, 1 answers
  1. Rocky Fernandes
    Rocky Fernandes avatar
    12 posts
    Member since:
    Jul 2009

    Posted 24 Jul 2009 Link to this post

    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

     

  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 27 Jul 2009 Link to this post

    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.
  3. DevCraft banner
Back to Top