Hi,
I would like to create and use a converter to change the background of a single selected button among the three buttons available. I don't want to handle a click event of the buttons and handle it from code behind and so tried different ways to create the converters, however it didn't work. Below I am providing a sample of my scenario. Any help would be greatly appreciated. Thank you.
<StackPanel Grid.Row="0" HorizontalAlignment="Center" x:Name="FirstRowControl" Orientation="Horizontal" Margin="232,0,233,0">
<telerik:RadButton Name="btn1" FontWeight="SemiBold" Margin="5" Content="Button 1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Height="25" BorderBrush="Black" Command="{Binding UpdateTabCommand}" >
<telerik:RadButton.CommandParameter>
<models:Tabs>Button1</models:Tabs>
</telerik:RadButton.CommandParameter>
</telerik:RadButton>
<telerik:RadButton Name="btn2" FontWeight="SemiBold" Margin="5" Content="Button 2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="25" BorderBrush="Black" Command="{Binding UpdateTabCommand}" >
<telerik:RadButton.CommandParameter>
<models:Tabs>Button2</models:Tabs>
</telerik:RadButton.CommandParameter>
</telerik:RadButton>
<telerik:RadButton Name="btn3" FontWeight="SemiBold" Margin="5" Content="Button 3" HorizontalAlignment="Left" VerticalAlignment="Top" Width="180" Height="25" BorderBrush="Black" Command="{Binding UpdateTabCommand}" >
<telerik:RadButton.CommandParameter>
<models:Tabs>Button3</models:Tabs>
</telerik:RadButton.CommandParameter>
</telerik:RadButton>
</StackPanel>
Code in the VM:
public DelegateCommand<Tabs?> UpdateTabCommand
{ get; }
public Tabs SelectedTab
{
get { return base.GetProperty<PedpTabs>(defaultValueFactory: () => Tabs.Button1); }
set { base.SetProperty(value); }
}
public enum Tabs
{
Button1,
Button2,
Button3
}
public ClassVM()
{
UpdateTabCommand = new DelegateCommand<Tabs?>(OnChangeTabExecute);
}
private void OnChangeTabExecute(PedpTabs? selectedTab)
{
this.SelectedTab = selectedTab ?? Tabs.StateChanges;
}
protected override void OnPropertyChanged(string propertyName)
{
base.OnPropertyChanged(propertyName);
switch (propertyName)
{
case nameof(SelectedTab):
OnTabChanged();
break;
}
}
private void OnTabChanged()
{
switch (SelectedTab)
{
case Tabs.Button1:
MessageList = Messages2080;
break;
case Tabs.Button2:
MessageList = Messages2088;
break;
case Tabs.Button3:
MessageList = Messages2010;
break;
}
}
Thanks, Chand
Hi, I have a hierarchy that looks something like this:
<RadLayoutControl>
<LayoutGroup>
<LayoutExpanderGroup>
<SomeControl/>
</LayoutExpanderGroup>
<LayoutExpanderGroup>
<RadGridView/>
</LayoutExpanderGroup>
</LayoutGroup>
</RadLayoutControl>
My RadGridView has many columns and rows and so causes the entire <RadLayoutControl> to scroll. Is it possible to configure this view so that only the <LayoutExpanderGroup> that contains the <RadGridView> will scroll?
Any help would be appreciated.
Hi,
I'm using the CloudUpload in my application, and I was wondering if there was anyway to update the tooltip language resource of the RadCloudUploadListItem Close Button (I joined a screenshot of the tooltip I'm talking about). I wasn't able to find it in the xaml style template.
Could someone help me with this issue?
Thank you,
I want to hide only the horizontal or vertical scrollbar. Is that possible ?
The only solution I found now is the following style :
<
Style
TargetType
=
"telerik:PanZoomBar"
>
<
Setter
Property
=
"Visibility"
Value
=
"{Binding Customization.ChartZoomMode, Converter={StaticResource ChartScrollbarVisibilityConverter}}"
/>
</
Style
>
The problem here is that it is hiding both Scrollbars. Is there a option where I can decide which one I want to hide ?
How can I use correctly the above xaml in code behind ?
This is not working :
return
new
RadCartesianChart
{
//Resources = new ResourceDictionary()
//{
// {"HideScrollBarStyle", new Style(typeof(PanZoomBar))
// {
// Setters =
// {
// new Setter()
// {
// Property = ContentControl.VisibilityProperty,
// Value = Visibility.Collapsed,
// }
// }
// }
// }
//},
HorizontalAxis =
new
CategoricalAxis()
{
LabelFitMode = AxisLabelFitMode.Rotate,
PlotMode = hasBarSeries ? AxisPlotMode.BetweenTicks : AxisPlotMode.OnTicks,
Title = Customization.XAxisName?.ToUpper(),
SmartLabelsMode = AxisSmartLabelsMode.SmartStep ,
LabelTemplate =
new
DataTemplate()
{
VisualTree = xAxisFormat,
},
//GapLength = 0.15,
},
VerticalAxis =
this
.HasMultipleAxis ?
null
: GetYAxis(),
SmartLabelsStrategy =
new
ChartSmartLabelsStrategy()
{
ShouldMinimizeConnectorConflicts =
true
,
},
......
......
.....
I am using RadSpellChecker to spell check a WPF TextBox. In a different area of my application, I am using RadRichTextBox and I have a custom dialog for spell checking. When I spell check the WPF TextBox, I get the built-in spell checking dialog instead of my custom dialog. Is there a way to also use the custom dialog when spell checking a WPF TextBox?
Brian
I have created a simple project to start working RadImageEditor.
The problem is that my image doesn't display in the editor at all. Even when I execute the Open command of the ImageEditor.
I'm not sure if the ImageEditor isn't visible or the image doesn't get loaded inside of it.
Since I'm not allowed to attach a zip file I'll add the code of each class of my project:
MainWindow.Xaml:
<Window x:Class="WpfApp4.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<telerik:RadImageEditor HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScaleFactor="0" x:Name="ImageEditor" Background="Red"/>
<Button Click="Button_Click" Content="Load picture" Grid.Row="1" />
</Grid>
</Window>
MainWindow.Xaml.cx:
namespace WpfApp4
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
ImageExampleHelper.LoadSampleImage(this.ImageEditor, "RadImageEditor.png");
}
private void Button_Click(object sender, RoutedEventArgs e)
{
this.ImageEditor.Commands.Open.Execute(this.ImageEditor);
}
}
}
ImageExampleHelper.cs:
public class ImageExampleHelper
{
public static void LoadSampleImage(RadImageEditor imageEditorUI, string image)
{
Stream stream1 = File.OpenRead("D://test image//radImageEdito.png");
string extension = Path.GetExtension("D://test image//radImageEdito.png").ToLower();
IImageFormatProvider formatProvider = ImageFormatProviderManager.GetFormatProviderByExtension(extension);
if (formatProvider != null)
{
imageEditorUI.Image = formatProvider.Import(stream1);
imageEditorUI.ApplyTemplate();
imageEditorUI.ScaleFactor = 0;
}
stream1.Close();
}
}
Thanks!
Mahdieh,