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

Create RadRibbonBar Programmatically

3 Answers 90 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
July
Top achievements
Rank 2
July asked on 27 Aug 2012, 06:02 PM
I created the radribbonbar programmatically using the trial dll.
But when add the bouhgt dll by the company, the code doesn't work.

for example:

this is my aspx.cs
 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) CreateMenu();


    }


    private void CreateMenu()
    {
        RadRibbonBar menu = new RadRibbonBar();
        menu.ID = "Menu";


        RibbonBarTab tab1 = new RibbonBarTab();
        tab1.ID = "Tab1";
        tab1.Text = "Tab1";
        RibbonBarGroup group1 = new RibbonBarGroup();
        group1.ID = "group1";
        RibbonBarButton btn = new RibbonBarButton();
        btn.ID = "btn";
        btn.Text = "btn";
        group1.Items.Add(btn);
        btn = new RibbonBarButton();
        btn.ID = "btn1";
        btn.Text = "btn1";
        group1.Items.Add(btn);
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab2";
        tab1.Text = "Tab1";
         group1 = new RibbonBarGroup();
        group1.ID = "group21";
        group1.Text = "group2";
        btn = new RibbonBarButton();
        btn.ID = "btn1";
        btn.Text = "btn1";
        group1.Items.Add(btn);
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab3";
        tab1.Text = "Tab1";
        group1 = new RibbonBarGroup();
        group1.ID = "group3";
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab4";
        tab1.Text = "Tab1";
        group1 = new RibbonBarGroup();
        group1.ID = "group4";
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);
 
        header.Controls.Add(menu);
    }


aspx:
 <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<script type="text/javascript">
//Put your JavaScript code here.
    </script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<div>
    <div id="header" runat="server">
    </div>
</div>
</form>



js error:
attach 1 and 2



How I can fix this

thanks

3 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 28 Aug 2012, 08:36 AM
Hello,

Those issues have already been addressed and fixes for them are available in the latest internal builds.

The issue in general is that you have not provided a title (or text) for the ribbon groups, hence the error.

Greetings,
Ivan Zhekov
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
July
Top achievements
Rank 2
answered on 28 Aug 2012, 12:37 PM
the company has this version
Telerik.Web.UI_2012_2_724_Dev_hotfix

It is the last version?

thanks
0
Ivan Zhekov
Telerik team
answered on 28 Aug 2012, 01:51 PM
Hello,

As of today, the latest internal version is Telerik.Web.UI_2012_2_828. Prior that was Telerik.Web.UI_2012_2_821, which is still newer than the one you are using currently. If you update to that latest version, you shouldn't be getting the errors you are getting.

Regards,
Ivan Zhekov
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
July
Top achievements
Rank 2
Answers by
Ivan Zhekov
Telerik team
July
Top achievements
Rank 2
Share this question
or