merge commandbars

4 posts, 0 answers
  1. francis
    francis avatar
    9 posts
    Member since:
    Feb 2011

    Posted 17 Mar 2011 Link to this post

    Hello, Is it possible to merge a commandbar from a child with the parent commandbar?
    thanks,
    francis
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 22 Mar 2011 Link to this post

    Hi francis,

    Yes, you can merge the command bars although there is no built-n functionality for this. I am not sure if you want to merge the strips or the items but using the proper collections this should not be a problem. For example if you want to merge the items of two or more CommandBarStripElements, you can get the items from the Items collection:
    foreach(RadCommandBarBaseItem item in commandBarStripElement2.Items)
    {
         commandBarStripElement1.Items.Add(item);
    }
     
    commandBarStripElement2.Items.Clear();


    If you want to merge the strips of two or more RadCommandBars you can get all strips by traversing all rows and extracting them from their Strips collection:
    foreach (CommandBarRowElement row in radCommandBar1.Rows)
    {
        foreach (CommandBarStripElement strip in row.Strips)
        {
            radCommandBar2.Rows[0].Strips.Add(strip);
        }
        row.Strips.Clear();
    }

    I hope you find this useful. If you have any further questions, do not hesitate to ask.

    All the best,
    Ivan Todorov
    the Telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
  4. francis
    francis avatar
    9 posts
    Member since:
    Feb 2011

    Posted 24 Mar 2011 Link to this post

    Hi Ivan,

    Thanks for the reply.  I'm trying to merge a commandbar from a child form with the commandbar on a mdi parent form when the child form loads. can you provide example?

    thanks
    Francis
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 30 Mar 2011 Link to this post

    Hi francis,

    You can find an example in the attached project.

    I hope you find it useful. Please let me know if you need any further help.

    Greetings,
    Ivan Todorov
    the Telerik team
Back to Top