Hi,
As mentioned above, I would like to add a button that allows me to select which columns of the radgridview that I want to show. May I seek your advise on this?
This is about the RadSplitButton in UI for WPF. I use the Windows 8 theme.
RadSplitButton closed:
RadSplitButton opened:
I want to change that blue color (#25A0DA) to something that's not associated with the theme. I already change the colors of the Windows8Palette and the blue default color seems to be the AccentColor - I don't want to change the AccentColor, though (I set that to something different, which looks great everywhere except the RadSplitButton).
I already added the control template for RadSplitButton and it does work - when I change values I see those in the UI. But which value do I have to change to change the color when RadSplitButton was opened? I couldn't find it.
The XAML sample from the screenshots:
<telerik:RadSplitButton Content="This is a RadSplitButton" HorizontalAlignment="Left" Margin="80,70,0,0" VerticalAlignment="Top">
<telerik:RadSplitButton.DropDownContent>
<StackPanel>
<telerik:RadButton Content="This is a RadButton" HorizontalContentAlignment="Left"/>
<telerik:RadButton Content="This is a RadButton (2)" HorizontalContentAlignment="Left"/>
</StackPanel>
</telerik:RadSplitButton.DropDownContent>
</telerik:RadSplitButton>
Hi !
I'm using a radButton because if i use radRadioButton when i've "checked" it the background theme is green like the same unlock svg color, but i want make an exception background color when my RadRadioButton use this svg.
But my menu selection must be all radradiobutton because when one of them is selection page content (ViewModel) must change. the lock/unlock buttons are new because my project change and next access to the parts and conditioned by a validation page.
<UserControl.Resources>
<PathGeometry x:Key="UnLock" Figures="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z"/>
<PathGeometry x:Key="Lock" Figures="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"/>
</UserControl.Resources>
<Grid Grid.Column="1" Width="50" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,5">
<telerik:RadButton Cursor="Hand" Padding="4" Command="{Binding InitValidationCommand}">
<Viewbox Width="32" Height="32">
<Canvas Width="24" Height="24">
<Path>
<Path.Style>
<Style TargetType="Path">
<Setter Property="Data" Value="{StaticResource ResourceKey=Lock}"/>
<Setter Property="Fill" Value="#F44336"/>
<Style.Triggers>
<DataTrigger Binding="{Binding InitEtude.IsDeverrouille}" Value="True">
<Setter Property="Data" Value="{StaticResource ResourceKey=UnLock}" />
<Setter Property="Fill" Value="{telerik:Windows11Resource ResourceKey=AccentBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Canvas>
</Viewbox>
</telerik:RadButton>
</Grid>
i've tested in other part of my project many option but to overflow theme checked definition :
- no success
<telerik:RadRadioButton Width="115" Height="50" Cursor="Hand" Margin="0,0,0,5" GroupName="test">
<ControlTemplate TargetType="telerik:RadRadioButton">
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Red"/>
<Setter Property="helpers:ThemeHelper.CheckedBackgroundBrush" Value="red"/>
<Setter Property="helpers:ThemeHelper.CheckedBrush" Value="blue"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="Red"/>
<Setter Property="helpers:ThemeHelper.CheckedBackgroundBrush" Value="red"/>
<Setter Property="helpers:ThemeHelper.CheckedBrush" Value="blue"/>
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Background" Value="Red"/>
<Setter Property="helpers:ThemeHelper.CheckedBackgroundBrush" Value="red"/>
<Setter Property="helpers:ThemeHelper.CheckedBrush" Value="blue"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</telerik:RadRadioButton>
Hello,
I'm not sure if this is a bug or if this just isn't the way to change the OverrideColor for this case. I ran into an error when attempting to use the following:
<telerik:RadToggleButton Grid.Row="0" Background="Transparent" BorderThickness="0">
<telerik:RadToggleButton.Content>
<telerik:RadSvgImage Height="60" Width="60">
<telerik:RadSvgImage.Style>
<Style TargetType="telerik:RadSvgImage">
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=telerik:RadToggleButton}}" Value="False">
<Setter Property="UriSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}, Path=PlusImagePath}"/>
<Setter Property="OverrideColor" Value="Blue"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=telerik:RadToggleButton}}" Value="True">
<Setter Property="UriSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}, Path=MinusImagePath}"/>
<Setter Property="OverrideColor" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadSvgImage.Style>
</telerik:RadSvgImage>
</telerik:RadToggleButton.Content>
</telerik:RadToggleButton>
My intention here is to have the OverrideColor change the color of the svg image I am also setting using UriSource. I get the following error only when going from IsChecked being true to being false.
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Telerik.Windows.Controls StackTrace: at Telerik.Windows.Controls.RadSvgImage.OverrideColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in Telerik.Windows.Controls\RadSvgImage.cs:line 414 at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, FrugalStructList`1& dependents, Boolean invalidateOnlyContainer) at System.Windows.StyleHelper.OnBindingValueInStyleChanged(Object sender, BindingValueChangedEventArgs e) at System.Windows.Data.BindingExpressionBase.ChangeValue(Object newValue, Boolean notify) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange) at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange) at MS.Internal.Data.ClrBindingWorker.OnSourceInvalidation(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetCurrentValueInternal(DependencyProperty dp, Object value) at System.Windows.Controls.Primitives.ToggleButton.OnToggle() at Telerik.Windows.Controls.RadToggleButton.OnClick() in Telerik.Windows.Controls\RadToggleButton.cs:line 201 at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at Telerik.Windows.Controls.RadToggleButton.OnMouseLeftButtonUp(MouseButtonEventArgs e) in Telerik.Windows.Controls\RadToggleButton.cs:line 231 at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run() at RadSVGImageTest.App.Main()
Perhaps this combination of setters isn't possible? I've attached an example project. Any help is appreciated.
Thank You,
Giuliano
Hello,
I would like to add a slide button under the tile view like screenshot.
How can I add a button under the tile view?
Thanks for your feedback.
We recently updated to version 2024.1.312. After the update, we get an exception (see stack trace below) or freezing with many of our RadToggleSwitchButtons. It seems to only affect the ones that are backstage in a RadDataForm. I found https://feedback.telerik.com/wpf/1645011-buttons-nullreferenceexception-when-setting-ischecked-of-radtoggleswitchbutton-before-the-control-is-added-to-the-visual-tree, but the workaround suggested there doesn't work for us, even if we leave the animations enabled.