Aligning Buttons in RadToolbar

10 posts, 0 answers
  1. Chris Boarman
    Chris Boarman avatar
    9 posts
    Member since:
    Dec 2009

    Posted 08 Jun 2010 Link to this post

    Hello,

    Is there a simple way to right-align a button in the RadToolbar? Frequently, it is nice to have a right-aligned help button or refresh button in a tool bar. I tried setting the HorizontalAlignment property of the contained button to Right, but that didn't work.
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 Jun 2010 Link to this post

    Hello Chris Boarman,

    This is currently not supported. I added your request to the product backlog however we can not stick to any specific date for implementation.

    Kind regards,
    Valentin.Stoychev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sypher
    Sypher avatar
    79 posts
    Member since:
    Aug 2006

    Posted 08 Feb 2011 Link to this post

    woops
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Feb 2011 Link to this post

    Hello sypher,

    You can vote for this issue here in order to increase its priority.

    Kind regards,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 07 May 2012 Link to this post

    We need this feature too. I am surprised we can't do this yet.
  7. David
    David avatar
    19 posts
    Member since:
    Jun 2008

    Posted 17 May 2012 Link to this post

    I need to be able to right align some content in the radtoolbar. * Bump *
  8. Ryan
    Ryan avatar
    1 posts
    Member since:
    Aug 2013

    Posted 17 Sep 2015 Link to this post

    Is this still not available yet?
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 18 Sep 2015 Link to this post

    Hi Ryan,

    I pleased to let you know that this feature is ready since Q3 2014. Please check out its supporting article and XAML SDK sample in our GitHub Repository.

    Regards,
    Petar Mladenov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Adrien
    Adrien avatar
    3 posts
    Member since:
    Nov 2015

    Posted 02 Dec 2015 in reply to Petar Mladenov Link to this post

    Hello,

     is it possible to center-align buttons in a RadToolbar ? I attach a picture of the toolbar I currently have (using "basic" toolbar), but the way I position the buttons doesn't work when the zoom changes. Then, I want to use the RadToolbar to do so.

    Thank you, 
    Adrien

  11. Ivan
    Admin
    Ivan avatar
    44 posts

    Posted 03 Dec 2015 Link to this post

    Hi Adrien,

    The RadToolBar does not support center-alignment of it's items. They can be left-aligned or right-aligned. You can check the Item Alignment article for more information.

    However there is a way to solve this situation. You can set margin to the first centered button inside the tool bar. This margin will be dynamically calculated on re-size. Here is an example:
    private void RadToolBar_SizeChanged(object sender, SizeChangedEventArgs e)
    {
        RadToolBar toolBar = sender as RadToolBar;
        double toolBarWidth = toolBar.ActualWidth;
        var children = toolBar.Items;
        double buttonsTotalWidth = 0;
     
        foreach (Control button in children)
        {
            buttonsTotalWidth += button.ActualWidth;
        }
     
        const double sideConstants = 20;
        double freeSpace = toolBarWidth - buttonsTotalWidth - sideConstants;
        double offset = freeSpace / 2;
     
        ButtonView.Margin = new Thickness(offset, 0, 0, 0);
    }
    You can check this approach in the sample project attached.

    Regards,
    Ivan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready