Create RadRibbonBar Programmatically

4 posts, 0 answers
  1. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 27 Aug 2012 Link to this post

    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

  2. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 28 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 28 Aug 2012 Link to this post

    the company has this version
    Telerik.Web.UI_2012_2_724_Dev_hotfix

    It is the last version?

    thanks
  5. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 28 Aug 2012 Link to this post

    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.
Back to Top