HtmlPlaceHolder Performance

1 posts, 0 answers
  1. Deven
    Deven avatar
    33 posts
    Member since:
    Apr 2009

    Posted 09 Jul 2009 Link to this post

    I am working on an application that displays reports off SSRS to users. I added a DragableListBox (from Telerik examples) on LHS. A Tab hosting, BlackLight Dockable panels on RHS. Now I can drag a report on the tab and it shows up in the dockable panel. It works nicely, until I have dropped about 6 reports. Which means I have 6 HTMLPlaceHolders on screen. Now the dragging from list box and other functions become very slow. Ok I thought, lets delete some panels with HtmlPlaceHolders and try. I deleted all the panels (runtime), but it still stays slow. 

    For your better understanding, below is the converter for my Tab control. Which adds a DockPanelHost in each tab and loads Panels (hosting HtmlPlaceHolder) under the host. One Tab has one DockingHost and one dockinghost has many docking panels and each docking panel has an html place holder.

    Is this anything to do with HtmlPlaceHolder?

    Also I discovered that at runtime, if I keep creating instance of HTMLPlaceHolder alls fine, but as soon as I delete one of them, it slows down the whole application. I will appreciate an urgent response.


     

    1 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)  
    2         {  
    3             var source = value as ObservableCollection<PortfolioTab>;  
    4             DataTemplate dt = App.Current.Resources["tabHeader"] as DataTemplate;  
    5  
    6             if (source != null)  
    7             {  
    8                 ObservableCollection<RadTabItem> result = new ObservableCollection<RadTabItem>();  
    9                 foreach (PortfolioTab tab in source)  
    10                 {  
    11  
    12                     DragDockPanelHost host = new DragDockPanelHost();  
    13                     host.MinimizedPosition = MinimizedPositions.Top;  
    14                     host.MaxColumns = 0;  
    15                     host.MaxRows = 0;  
    16                     host.Opacity = 0.9;  
    17                     host.UseLayoutRounding = true;  
    18                     host.Background = new SolidColorBrush(Colors.Transparent);  
    19                     //Hide all the html contents between panel resize for smoother transition  
    20                     host.BeginResize += new EventHandler(DragPanelHost_BeginResize);  
    21                     host.EndResize += new EventHandler(DragPanelHost_EndResize);  
    22                     //Host should be hidden by default  
    23                     //Host will show when respective tab is selected  
    24                     host.Visibility = Visibility.Collapsed;  
    25  
    26                     //Enable Drop on Host  
    27                     RadDragAndDropManager.SetAllowDrop(host, true);  
    28                     host.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnReportDropQuery));  
    29                     host.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnReportDropInfo));  
    30  
    31                     if (tab.TabReportInfos != null)  
    32                     {  
    33                         foreach (ReportInfo report in tab.TabReportInfos)  
    34                         {  
    35                             host.AddPanel(CreatePanel(report, false));  
    36                         }  
    37                     }  
    38  
    39                     Binding binding = new Binding("TabTitle");  
    40                     binding.Source = tab;  
    41                     RadTabItem taby = new RadTabItem()  
    42                     {  
    43                         Tag = tab.TabID,  
    44                         Content = host 
    45                     };  
    46                     taby.SetBinding(RadTabItem.HeaderProperty, binding);  
    47                     result.Add(taby);  
    48  
    49  
    50                 }  
    51                 return result;  
    52             }  
    53             return null;  
    54         } 
Back to Top