Resize RibbonbarGroup in codebehind

4 posts, 0 answers
  1. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 08 Dec 2011 Link to this post

    Dear Sir/Madam,

    Here I am adding Ribbonbar, RibbonbarTab, RibbonbarGroup and RibbonbarButtons from codebehind. Now in output window I am getting somehow mess up situation for buttons in groups. Please assist me how to resize Ribbonbar Groups? Also please find attached image for better understanding.

    Here Is my Code to add Ribbonbar.

    RibbonBarTab objRibbonBarTab = new RibbonBarTab();
    RibbonBarGroup objRibbonBarGroup = new RibbonBarGroup();
    RibbonBarButton objRibbonBarButton = new RibbonBarButton();
    foreach (AM am in objList)
    {
        //Prepare tabs and add it to ribbon bar
        objRibbonBarTab = new RibbonBarTab();
        objRibbonBarTab.Text = am.DisplayName;
        objRibbonBarTab.ID = am.Action_Menu_ID.ToString();
        objRibbonBarTab.ToolTip = am.Description;
        objRadRibbonBar.Tabs.Add(objRibbonBarTab); //Adding Tab to RibbonBar
     
        //Add Groups to above tab
        if (ChildList.Count > 0)
        {
            foreach (Child objSingle in ChildList)
            {
                objRibbonBarGroup = new RibbonBarGroup();
                objRibbonBarGroup.EnableLauncher = true;
                objRibbonBarGroup.Text = objSingle.DisplayName;
                objRibbonBarGroup.ID = objSingle.ActionMenuChildID.ToString();
                objRibbonBarGroup.ToolTip = objSingle.Description;
                objRibbonBarTab.Groups.Add(objRibbonBarGroup); //Adding Groups to Tabs
     
                //Add RaButtons to above Groups
                if (objRadGroupsList.Count > 0)
                {
                    foreach(Child objMap in objRadGroupsList)
                    {
                        objRibbonBarButton = new RibbonBarButton();
                        objRibbonBarButton.Text = objMap.DisplayName;
                        objRibbonBarButton.ID = objMap.ActionMenuChildID.ToString();
                        objRibbonBarButton.ToolTip = objMap.Description;
                        objRibbonBarButton.Value = objMap.Name;
                         
                        switch(objMap.Size)
                        {
                            case "Large":
                                objRibbonBarButton.Size = RibbonBarItemSize.Large;
                                break;
                            case "Medium":
                                objRibbonBarButton.Size = RibbonBarItemSize.Medium;
                                break;
                            case "Small":
                                objRibbonBarButton.Size = RibbonBarItemSize.Small;
                                break;
                        }
     
                        RibbonBarItem objRibbonBarItem = objRibbonBarButton;
                        objRibbonBarGroup.Items.Add(objRibbonBarItem);
                    }
                }
            }
        }
    }
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 12 Dec 2011 Link to this post

    Hello Kaushal,

    Thank you for contacting us.

    The issue that you encounter seems very strange indeed. Do you have any other css classes that you apply to the RadRibbonBar control (in the markup for instance) besides the code that you pasted in the ticket? Can you also clarify the version of the controls that you are using since we have fixed many bugs in the latest release? If you could send us a simplified runnable page where we could observe the issue would be very helpful as well.

    Thank you in advance for your cooperation.

    Best wishes,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 12 Dec 2011 Link to this post

    Hi Kate,

    First of all thanks to focus on my issue. Yes It seems very strange issue. I am using Q3 2011 (2011.3.1115.40) version. and I have not applied any css class not any extended properties or attributes. My skin for telerik control is "Default".

    Thanks & Regards,

    Kaushal Jani
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 12 Dec 2011 Link to this post

    Thank you for clarifying that. However, using the above mentioned version of the controls I am not able to reproduce the issue. Therefore I would like to ask you if you could open a support ticket and send us a simplified runnable project with only the minimum code that is necessary to replicate the issue.

    Thank you in advance.   

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top