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

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

4 Answers 239 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Devid
Top achievements
Rank 1
Devid asked on 10 Oct 2016, 03:20 PM

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>

4 Answers, 1 is accepted

Sort by
0
Devid
Top achievements
Rank 1
answered on 11 Oct 2016, 09:52 AM
No one ?
0
Dilyan Traykov
Telerik team
answered on 11 Oct 2016, 10:24 AM
Hello ,

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.
0
Devid
Top achievements
Rank 1
answered on 11 Oct 2016, 10:52 AM
thanks for the answer, but it is not working. I get at ContentPresenter the error that it is invalid XAML
0
Accepted
Dilyan Traykov
Telerik team
answered on 11 Oct 2016, 02:32 PM
Hello ,

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.
Tags
GridView
Asked by
Devid
Top achievements
Rank 1
Answers by
Devid
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or