How to place the Content of ControlPanelItem to the left side ?

5 posts, 1 answers
  1. Devid
    Devid avatar
    10 posts
    Member since:
    Aug 2016

    Posted 10 Oct Link to this post

    I want to set the two first Buttons of the RadGridView ControlPanelItems to the left. Is this possible and how. The image describes what I want to do. Below you will find also my source code. 

     

     

    01.<telerik:RadGridView.ControlPanelItems>
    02. 
    03.    <telerik:ControlPanelItem>
    04.        <telerik:ControlPanelItem.ButtonContent>
    05.            <telerik:RadButton Name="EnlargeFontSize" Click="EnlargeFontSize_OnClick">
    06.                <DockPanel>
    07.                    <TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontWeight="Bold" FontSize="16"/>
    08.                    <TextBlock TextAlignment="Center"/>
    09.                </DockPanel>
    10.            </telerik:RadButton>
    11.        </telerik:ControlPanelItem.ButtonContent>
    12.    </telerik:ControlPanelItem>
    13. 
    14.    <telerik:ControlPanelItem>
    15.        <telerik:ControlPanelItem.ButtonContent>
    16.            <telerik:RadButton Name="ReduceFontSize" Click="ReduceFontSize_OnClick" >
    17.                <DockPanel>
    18.                    <TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontWeight="Bold" FontSize="16"/>
    19.                    <TextBlock TextAlignment="Center"/>
    20.                </DockPanel>
    21.            </telerik:RadButton>
    22.        </telerik:ControlPanelItem.ButtonContent>
    23.    </telerik:ControlPanelItem>
    24. 
    25.    <telerik:ControlPanelItem>
    26.        <telerik:ControlPanelItem.ButtonContent>
    27.            <telerik:RadButton Click="ResetView_Click" HorizontalContentAlignment="Stretch">
    28.                <DockPanel>
    29.                    <TextBlock Text="" FontFamily="Segoe UI Symbol" Foreground="Red"/>
    30.                    <TextBlock Text="Anpassung Zurücksetzen" TextAlignment="Center"/>
    31.                </DockPanel>
    32.            </telerik:RadButton>
    33.        </telerik:ControlPanelItem.ButtonContent>
    34.    </telerik:ControlPanelItem>
    35. 
    36.</telerik:RadGridView.ControlPanelItems>

  2. Devid
    Devid avatar
    10 posts
    Member since:
    Aug 2016

    Posted 11 Oct in reply to Devid Link to this post

    No one ?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 11 Oct Link to this post

    Hello Deivid,

    In order to achieve the desired result, you will need to modify the default control template for the RadGridView control and more specifically, the PART_ControlPanelItemsControl ItemsControl element.

    I'm attaching a sample project where I've extracted the default template for the Office_Black theme and replaced the default ItemsPanel with a DockPanel.

    Please have a look at the attached project and let me know whether such an approach would work for you.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  5. Devid
    Devid avatar
    10 posts
    Member since:
    Aug 2016

    Posted 11 Oct Link to this post

    thanks for the answer, but it is not working. I get at ContentPresenter the error that it is invalid XAML
  6. Answer
    Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 11 Oct Link to this post

    Hello Deivid,

    I'm attaching a modified version of the project which should build without any errors. Please have a look at it and let me know if it works for you.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready