I am using the Office 2013 Theme on my project and the arrow on the RadComboBox is very small. Also, for some reason, you have to click directly on the arrow itself in order for the dropdown to open. If you click anywhere in the ToggleButton area around the arrow it will not open. So anywho, I decided to try changing the toggle button on the control to make it larger. I basically got some code for a normal ComboBox from https://stackoverflow.com/questions/27128526/how-to-change-combobox-arrow-image-in-wpf and modified it to work with the telerik:RadComboBox. The control shows as intended in the XAML design window but, when I run the application the styling does not take effect. Any idea what I may be missing here?
<
Page
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:ExtendedGridControl
=
"clr-namespace:ExtendedGrid.ExtendedGridControl;assembly=ExtendedGrid"
xmlns:ExtendedColumn
=
"clr-namespace:ExtendedGrid.ExtendedColumn;assembly=ExtendedGrid"
x:Class
=
"SuperGateWPFT.Page1"
xmlns:rv
=
"clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
xmlns:local
=
"clr-namespace:SuperGateWPFT"
mc:Ignorable
=
"d"
d:DesignHeight
=
"775"
d:DesignWidth
=
"1200"
MinWidth
=
"1200"
MinHeight
=
"775"
Title
=
"SuperGate"
Loaded
=
"Page_Loaded"
>
<
Page.Resources
>
<DataTemplate
x:Key="MultipleSelectionBoxTemplateDept">
<TextBlock Text="{Binding
ElementName=cmbDept, Path=SelectedItems.Count, StringFormat='Selected Items
Count: {0}'}" Foreground="Red" FontWeight="Bold" />
</DataTemplate>
<!--Toggle Button Template-->
<
ControlTemplate
x:Key
=
"MyRadToggleButton"
TargetType
=
"telerik:RadToggleButton"
>
<
Grid
x:Name
=
"gd"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
Width
=
"25"
/>
</
Grid.ColumnDefinitions
>
<
Border
x:Name
=
"Border"
SnapsToDevicePixels
=
"True"
Grid.ColumnSpan
=
"2"
Background
=
"White"
BorderBrush
=
"Black"
BorderThickness
=
"1"
/>
<
Border
x:Name
=
"Boredr1"
SnapsToDevicePixels
=
"True"
Grid.Column
=
"1"
Margin
=
"1"
Background
=
"Black"
BorderBrush
=
"Black"
BorderThickness
=
"0,0,1,0"
/>
<
Path
x:Name
=
"Arrow"
SnapsToDevicePixels
=
"True"
Grid.Column
=
"1"
Fill
=
"White"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Data
=
"M 0 0 L 6 6 L 12 0 Z"
/>
<
ContentPresenter
Grid.Column
=
"0"
TextElement.Foreground
=
"Orange"
></
ContentPresenter
>
</
Grid
>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"telerik:RadToggleButton.IsMouseOver"
Value
=
"True"
>
<
Setter
TargetName
=
"Border"
Property
=
"BorderBrush"
Value
=
"Black"
/>
<
Setter
TargetName
=
"Boredr1"
Property
=
"BorderBrush"
Value
=
"Black"
/>
</
Trigger
>
<
Trigger
Property
=
"telerik:RadToggleButton.IsChecked"
Value
=
"True"
>
<
Setter
TargetName
=
"Arrow"
Property
=
"Data"
Value
=
"M 0 0 L 5 5 L 10 0"
/>
<
Setter
TargetName
=
"Arrow"
Property
=
"Fill"
Value
=
"White"
/>
<
Setter
TargetName
=
"Arrow"
Property
=
"Stroke"
Value
=
"White"
/>
<
Setter
TargetName
=
"Arrow"
Property
=
"StrokeThickness"
Value
=
"1.5"
/>
</
Trigger
>
<
Trigger
Property
=
"telerik:RadToggleButton.IsEnabled"
Value
=
"False"
>
<
Setter
TargetName
=
"gd"
Property
=
"Visibility"
Value
=
"Visible"
/>
</
Trigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>
<!--TextBox Template-->
<
ControlTemplate
x:Key
=
"ComboBoxTextBox"
TargetType
=
"TextBox"
>
<
ScrollViewer
x:Name
=
"PART_ContentHost"
Focusable
=
"False"
/>
</
ControlTemplate
>
<!--combobox-->
<
Style
x:Key
=
"MyComboBoxStyle"
TargetType
=
"telerik:RadComboBox"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:RadComboBox"
>
<
Grid
>
<
telerik:RadToggleButton
Name
=
"ToggleButton"
Foreground
=
"Black"
Template
=
"{StaticResource MyRadToggleButton}"
Focusable
=
"false"
IsChecked
=
"{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
ClickMode
=
"Press"
>
</
telerik:RadToggleButton
>
<
ContentPresenter
Name
=
"ContentSite"
IsHitTestVisible
=
"False"
Content
=
"{TemplateBinding SelectionBoxItem}"
ContentTemplate
=
"{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector
=
"{TemplateBinding ItemTemplateSelector}"
Margin
=
"3,3,23,3"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Left"
/>
<
TextBox
OverridesDefaultStyle
=
"True"
SelectionBrush
=
"Gray"
CaretBrush
=
"Black"
Margin
=
"0,0,30,0"
TextWrapping
=
"NoWrap"
x:Name
=
"PART_EditableTextBox"
FontFamily
=
"Segoe UI Dark"
Foreground
=
"Black"
Style
=
"{x:Null}"
Template
=
"{StaticResource ComboBoxTextBox}"
HorizontalAlignment
=
"Left"
Focusable
=
"True"
VerticalAlignment
=
"Center"
FontSize
=
"15"
Visibility
=
"Hidden"
IsReadOnly
=
"{TemplateBinding IsReadOnly}"
/>
<
Popup
Name
=
"Popup"
Grid.ColumnSpan
=
"2"
Placement
=
"Bottom"
IsOpen
=
"{TemplateBinding IsDropDownOpen}"
AllowsTransparency
=
"True"
Focusable
=
"False"
PopupAnimation
=
"Slide"
>
<
Grid
Name
=
"DropDown"
SnapsToDevicePixels
=
"True"
MaxWidth
=
"{TemplateBinding ActualWidth}"
MinWidth
=
"{TemplateBinding ActualWidth}"
MaxHeight
=
"{TemplateBinding MaxDropDownHeight}"
>
<
Border
Grid.ColumnSpan
=
"2"
Grid.RowSpan
=
"2"
x:Name
=
"DropDownBorder"
SnapsToDevicePixels
=
"True"
Background
=
"Transparent"
MaxWidth
=
"{TemplateBinding ActualWidth}"
BorderThickness
=
"1"
BorderBrush
=
"Black"
/>
<
ScrollViewer
Grid.ColumnSpan
=
"2"
ScrollViewer.CanContentScroll
=
"False"
Grid.Row
=
"1"
SnapsToDevicePixels
=
"True"
>
<
StackPanel
IsItemsHost
=
"True"
Background
=
"Transparent"
>
</
StackPanel
>
</
ScrollViewer
>
</
Grid
>
</
Popup
>
</
Grid
>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"IsEditable"
Value
=
"true"
>
<
Setter
Property
=
"IsTabStop"
Value
=
"false"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Background"
Value
=
"White"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Visibility"
Value
=
"Visible"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Foreground"
Value
=
"Black"
/>
<
Setter
TargetName
=
"ContentSite"
Property
=
"Visibility"
Value
=
"Hidden"
/>
</
Trigger
>
<
Trigger
Property
=
"HasItems"
Value
=
"false"
>
<
Setter
TargetName
=
"DropDownBorder"
Property
=
"MinHeight"
Value
=
"95"
/>
</
Trigger
>
<
Trigger
Property
=
"IsEnabled"
Value
=
"false"
>
<
Setter
Property
=
"IsTabStop"
Value
=
"false"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Visibility"
Value
=
"Visible"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Foreground"
Value
=
"Black"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"IsEnabled"
Value
=
"False"
/>
<
Setter
TargetName
=
"PART_EditableTextBox"
Property
=
"Background"
Value
=
"White"
/>
<
Setter
TargetName
=
"ContentSite"
Property
=
"Visibility"
Value
=
"Hidden"
/>
</
Trigger
>
<
Trigger
Property
=
"IsGrouping"
Value
=
"true"
>
<
Setter
Property
=
"ScrollViewer.CanContentScroll"
Value
=
"false"
/>
</
Trigger
>
<
Trigger
SourceName
=
"Popup"
Property
=
"Popup.AllowsTransparency"
Value
=
"true"
>
<
Setter
TargetName
=
"DropDownBorder"
Property
=
"Margin"
Value
=
"0,2,0,0"
/>
</
Trigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
<
Style.Triggers
>
</
Style.Triggers
>
</
Style
>
</
Page.Resources
>
<
Border
BorderThickness
=
"1"
BorderBrush
=
"Black"
Height
=
"27"
>
<
telerik:RadComboBox
Style
=
"{StaticResource MyComboBoxStyle}"
Name
=
"cmbDept"
AllowMultipleSelection
=
"True"
IsEditable
=
"False"
Width
=
"250"
Height
=
"25"
Margin
=
"0,0,0,0"
VerticalAlignment
=
"Top"
ItemsSource
=
"{Binding}"
MultipleSelectionBoxTemplate
=
"{StaticResource MultipleSelectionBoxTemplateDept}"
OpenDropDownOnFocus
=
"True"
></
telerik:RadComboBox
>
</
Border
>
Hi,
Was wondering on how I can access the sort order of items in the list so I can save their order?
I'm trying to bind my own ICommand to a RadRibbonButton's Command. My code is based on the example at http://demos.telerik.com/silverlight/#RichTextBox/Binding. The relevant bit of the XAML hierarchy is:
<telerik:RadRichTextBoxRibbonUI DataContext="{Binding Path=Commands, ElementName=richTextBox}">
<telerik:RadRichTextBoxRibbonUI.QuickAccessToolBar>
<telerik:QuickAccessToolBar>
<telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" <== This is the button I want to bind my MVVM ICommand to.
Obviously, I removed the RichTextCommand attached property, and tried to bind the Command property to the ICommand on my viewmodel, which is set as the DataContext for the Window. As you can see, the example XAML (above) modifies DataContext at the RadRichTextBoxRibbonUI level, so to get back to "my" DataContext, I set a "Name" to an element higher up the visual tree, and used "ElementName" in my Binding, with the intent of using "Path=DataContext.MySaveCommand"; but I got a binding error saying that it couldn't even find the named element. I also tried {x:Reference} but got circular reference issues with that.
Please can someone demonstrate how to bind that command using MVVM?
My project references the "2016.3.1024.45" version of the assemblies. I tried attaching it; but it wouldn't let me.
Hi,
Is there a way to show tool tip when I hovering on the "hour" or "day" in my time line? see attached file.
When I hovering 11 AM I want to show tool tip : 11:00 AM Aug 6 2012
(according the boundaries of the start/end TimeLine parameters)
When I hovering 13 PM I want to show tool tip : 13:00 PM Aug 6 2012
Hi,
I have a custom library which has provision to handle '+', '-' and many other operators along with custom functions. My requirement is that, I want spreadsheet to call my library to evaluate the cell formula. The operands of the operators ('+' etc. ) are custom and cannot be calculated by default engine.
Freeze Pane is not working as expected when we try to change freeze position programmatically.
When i try to change freeze position on a Button click the change in the UI for freeze is not happening.
Is anything i am doing wrong.?
Thanks
Hi
I have a RadCartesianChart (see XAML below) in a DataGridTemplateColumn but cannot find a way to reduce the amount of vertical space it is taking up. It seems to have a minimum height? Please advise.
<DataGridTemplateColumn Header="MyColumn"
IsReadOnly="True"
Width="300">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<telerik:RadCartesianChart Name="MyChart"
VerticalAlignment="Stretch"
Margin="10"
MaxHeight="20">
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartTooltipBehavior />
</telerik:RadCartesianChart.Behaviors>
<telerik:LineSeries ItemsSource="{Binding HistoricValues}"
ValueBinding="RawValue"
CategoryBinding="Year">
<telerik:LineSeries.PointTemplate>
<DataTemplate>
<Ellipse Fill="Blue"
Width="8"
Height="8"/>
</DataTemplate>
</telerik:LineSeries.PointTemplate>
</telerik:LineSeries>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Minimum="{Binding HistoricValueMinimum}"
Maximum="{Binding HistoricValueMaximum}"
MajorStep="{Binding HistoricValueStep}"
Visibility="Collapsed"/>
</telerik:RadCartesianChart.VerticalAxis>
</telerik:RadCartesianChart>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Thanks
Hello everyone.
I have noticed a strange RadGridView's behavior when I'm copying value from decimal cell (with DataFormat string) or exporting grid content to Excel.
If I use IQueryable as GridView ItemsSource, there is copied value the same as on-screen value. For example, I have a value 1000000 in data source and {0:N2} as DataFormatString, and a result value displayed in cell will be "1 000 000,00". When I copy this cell via Ctrl+C or export the datagrid to Excel, the result will be also "1 000 000,00", string with spaces between digits, not number. Math functions in Excel cannot be applied for that value.
However, If use IEnumberable instead IQueryable, the exported and pasted values will be absolutely the same as it in DataSource and will have their native type (decimal).
How can I copy the cell value in it native type using IQueryable as data source?