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

HtmlPlaceHolder Performance

0 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Deven
Top achievements
Rank 1
Deven asked on 09 Jul 2009, 03:28 PM
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.


 

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)  
        {  
            var source = value as ObservableCollection<PortfolioTab>;  
            DataTemplate dt = App.Current.Resources["tabHeader"] as DataTemplate;  
 
            if (source != null)  
            {  
                ObservableCollection<RadTabItem> result = new ObservableCollection<RadTabItem>();  
                foreach (PortfolioTab tab in source)  
                {  
 
                    DragDockPanelHost host = new DragDockPanelHost();  
                    host.MinimizedPosition = MinimizedPositions.Top;  
                    host.MaxColumns = 0;  
                    host.MaxRows = 0;  
                    host.Opacity = 0.9;  
                    host.UseLayoutRounding = true;  
                    host.Background = new SolidColorBrush(Colors.Transparent);  
                    //Hide all the html contents between panel resize for smoother transition  
                    host.BeginResize += new EventHandler(DragPanelHost_BeginResize);  
                    host.EndResize += new EventHandler(DragPanelHost_EndResize);  
                    //Host should be hidden by default  
                    //Host will show when respective tab is selected  
                    host.Visibility = Visibility.Collapsed;  
 
                    //Enable Drop on Host  
                    RadDragAndDropManager.SetAllowDrop(host, true);  
                    host.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnReportDropQuery));  
                    host.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnReportDropInfo));  
 
                    if (tab.TabReportInfos != null)  
                    {  
                        foreach (ReportInfo report in tab.TabReportInfos)  
                        {  
                            host.AddPanel(CreatePanel(report, false));  
                        }  
                    }  
 
                    Binding binding = new Binding("TabTitle");  
                    binding.Source = tab;  
                    RadTabItem taby = new RadTabItem()  
                    {  
                        Tag = tab.TabID,  
                        Content = host 
                    };  
                    taby.SetBinding(RadTabItem.HeaderProperty, binding);  
                    result.Add(taby);  
 
 
                }  
                return result;  
            }  
            return null;  
        } 

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Deven
Top achievements
Rank 1
Share this question
or