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

Resize RibbonbarGroup in codebehind

3 Answers 81 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Kaushal
Top achievements
Rank 1
Kaushal asked on 08 Dec 2011, 09:05 AM
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);
                }
            }
        }
    }
}

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 12 Dec 2011, 02:41 PM
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
0
Kaushal
Top achievements
Rank 1
answered on 12 Dec 2011, 02:52 PM
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
0
Kate
Telerik team
answered on 12 Dec 2011, 03:30 PM
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
Tags
RibbonBar
Asked by
Kaushal
Top achievements
Rank 1
Answers by
Kate
Telerik team
Kaushal
Top achievements
Rank 1
Share this question
or