Error while clicking the GroupElement in RadPanelbar

6 posts, 0 answers
  1. Dhirendra
    Dhirendra avatar
    4 posts
    Member since:
    May 2009

    Posted 29 May 2009 Link to this post

    Hi,

    I am adding the RadPanelbarGroupElement in RadPanelbar control on Runtime and adding the populated Treeview control in each group.  The RadPanelbar is in OutlookNav style and for each group, EnableHostControlMode is true.

    Everything works fine but if I click any of the Groups 4 times, the whole application hangs.

    Please suggest. See the code below:

     

    private void PreapreNavigationControl(Feature feature)
            {
              
                if (feature.Groups.Count > 0)
                {
                    foreach (Group group in feature.Groups)
                    {
                        //Adding the treeview
                        RadTreeView treeView = new RadTreeView();

                        RadPanelBarGroupElement groupElement = new RadPanelBarGroupElement();
                        radPanelBarNavigation.Items.AddRange(new Telerik.WinControls.RadItem[] {groupElement});
                      
                        ConfigureGroupElement(groupElement, group.Name, out treeView);

                        //Adding the Root Node
                        RadTreeNode rootNode = createAndRegisterTreeNode(group.Name, string.Empty);
                        treeView.Nodes.Add(rootNode);

                        foreach (Task task in group.Tasks)
                        {
                            RadTreeNode taskNode = createAndRegisterTreeNode(task.Name, task.NavigationCommandName);
                            rootNode.Nodes.Add(taskNode);
                        }

                    }
                }
            }

    private RadPanelBarGroupElement ConfigureGroupElement(RadPanelBarGroupElement groupElement, string groupElementName, out RadTreeView treeView)
    {
                //RadPanelBarGroupElement groupElement = new RadPanelBarGroupElement();
                treeView = new RadTreeView();

                //Designer Code

                groupElement.ContentPanel.SuspendLayout();
                ((System.ComponentModel.ISupportInitialize)(treeView)).BeginInit();

                groupElement.Caption = groupElementName;

                // groupElement.ContentPanel
                groupElement.ContentPanel.BackColor = System.Drawing.SystemColors.ControlLightLight;
                groupElement.ContentPanel.CausesValidation = true;
                groupElement.ContentPanel.Controls.Add(treeView);
                groupElement.EnableHostControlMode = true;
                groupElement.Text = groupElementName;
               
                // treeView

                treeView.BackColor = System.Drawing.Color.Transparent;
                treeView.Dock = System.Windows.Forms.DockStyle.Fill;
                treeView.Font = new System.Drawing.Font("Tahoma", 8.6F);
                treeView.Location = new System.Drawing.Point(0, 0);
                treeView.ShowItemToolTips = true;
                treeView.ShowLines = true;
                treeView.ShowRootLines = true;
                treeView.ThemeClassName = "Telerik.WinControls.UI.RadTreeView";
                treeView.Size = new System.Drawing.Size(277, 416);

                groupElement.ContentPanel.ResumeLayout(false);
                ((System.ComponentModel.ISupportInitialize)(treeView)).EndInit();

                return groupElement;
            }



  2. Dhirendra
    Dhirendra avatar
    4 posts
    Member since:
    May 2009

    Posted 29 May 2009 Link to this post

    My Company is waiting on this decision as this is a kind of POC (Proof of Concept) what i m tryin to perform. If this works, we will go ahead in purchasing the stuff from telerik.

    Please respond.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 29 May 2009 Link to this post

    Hello Dhirendra,

    Thank you for contacting us. I didn't manage to reproduce this behavior. Here I send you the test application which I have prepared. I hope this will help you, otherwise please send me a sample project which demonstrates the hang up behavior. The application I have prepared you is attached and is prepared using  RadControls for Winforms Q1 SP1 version. Please contact me again if you have more questions

    Best wishes,
    Boyko Markov
    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.
  5. Dhirendra
    Dhirendra avatar
    4 posts
    Member since:
    May 2009

    Posted 29 May 2009 Link to this post

    Hello Markov,

    Thanks for prompt reply. I have tried the solution sent by you, it works fine. Even i put my code into a sample application and that too works nicely without any errors.

    But this code I am using in SCSF (CAB application) and creating the Radpanelbar inside a View.  There it still hangs.
    Anyways when I changed the Radpanelbar style to "ListBar" , it is working without any issue inside CAB too.

    Could you look into the matter and try to create the things in a View of CAB applications rather than Windows application ?
  6. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 01 Jun 2009 Link to this post

    Hello Dhirendra,

    I am writing to let you know that we are testing the code that Boyko sent you with TCEK.
    I will follow up as soon as we finish testing.

    Greetings,
    Jordan
    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.
  7. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 02 Jun 2009 Link to this post

    Hello Dhirendra,

    This issue is getting even more interesting. I tested the code with the TCEK Finance Application example but still to no avail. Here is how I changed the Finance Application example to test the code:

    In the StockPortfolioView.cs file in the constructor I set the GroupStyle to OutlookNavPane. Then I commented the code in the AddStockItem method:

    public void AddStockItem(StockItem item, string groupName) 
            { 
                //StockItemElement stockElement = new StockItemElement(); 
                //stockElement.StockItem = item; 
                //stockElement.Size = new Size(200, 40); 
     
                //RadPanelBarGroupElement group = this.radPanelBar.Items[groupName] as RadPanelBarGroupElement; 
                //group.Items.Add(stockElement); 
                //stockElement.SetValue(StockItemElement.PositiveChangeProperty, item.Change > 0); 
            } 

    and finally I used your code in the AddValuationGroup method:

    public void AddValuationGroup(string caption, string name) 
            { 
                //RadPanelBarGroupElement newGroup = new RadPanelBarGroupElement(); 
                //newGroup.EnableHostControlMode = true; 
                //newGroup.Caption = caption; 
                //newGroup.Name = name; 
                //newGroup.Expanded = true; 
     
                //this.radPanelBar.Items.Add(newGroup); 
     
                RadTreeView treeView = new RadTreeView(); 
     
                RadPanelBarGroupElement groupElement = new RadPanelBarGroupElement(); 
                this.radPanelBar.Items.AddRange(new Telerik.WinControls.RadItem[] { groupElement }); 
     
                ConfigureGroupElement(groupElement, caption, out treeView); 
     
                //Adding the Root Node 
                RadTreeNode rootNode = new RadTreeNode("RootNode"); 
                treeView.Nodes.Add(rootNode); 
     
                for (int j = 0; j < 15; j++) 
                { 
                    RadTreeNode taskNode = new RadTreeNode("Task" + j); 
                    rootNode.Nodes.Add(taskNode); 
                } 
     
                treeView.ExpandAll(); 
            } 
    private RadPanelBarGroupElement ConfigureGroupElement(RadPanelBarGroupElement groupElement, string groupElementName, out RadTreeView treeView) 
            { 
                //RadPanelBarGroupElement groupElement = new RadPanelBarGroupElement(); 
                treeView = new RadTreeView(); 
     
                //Designer Code 
     
                groupElement.ContentPanel.SuspendLayout(); 
                ((System.ComponentModel.ISupportInitialize)(treeView)).BeginInit(); 
     
                groupElement.Caption = groupElementName; 
     
                // groupElement.ContentPanel 
                groupElement.ContentPanel.BackColor = System.Drawing.SystemColors.ControlLightLight; 
                groupElement.ContentPanel.CausesValidation = true
                groupElement.ContentPanel.Controls.Add(treeView); 
                groupElement.EnableHostControlMode = true
                groupElement.Text = groupElementName; 
     
                // treeView 
     
                treeView.BackColor = System.Drawing.Color.Transparent; 
                treeView.Dock = System.Windows.Forms.DockStyle.Fill; 
                treeView.Font = new System.Drawing.Font("Tahoma", 8.6F); 
                treeView.Location = new System.Drawing.Point(0, 0); 
                treeView.ShowItemToolTips = true
                treeView.ShowLines = true
                treeView.ShowRootLines = true
                treeView.ThemeClassName = "Telerik.WinControls.UI.RadTreeView"
                treeView.Size = new System.Drawing.Size(277, 416); 
     
                groupElement.ContentPanel.ResumeLayout(false); 
                ((System.ComponentModel.ISupportInitialize)(treeView)).EndInit(); 
     
                return groupElement; 
            } 

    May be we are missing something. Are you sure that you sent us all the relevant code. It will be best if you can try to reproduce the issue using the Finance Application example from the latest TCEK, so that we are working with the same code base.

    Sincerely yours,
    Jordan
    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready