Telerik Forums
UI for WPF Forum
1 answer
279 views

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

 

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Apr 2019
8 answers
884 views
Hi
we are now in the process of choosing a WPF control set and Telerik is the front runner.
One thing we would like to know is whether it is possible to easily change the funnel-like icon for the filter at the column header of GridView control. Some of the managers want to make sure that we are not going to be stuck with it.
Thanks
Nick
Martin Ivanov
Telerik team
 answered on 18 Apr 2019
1 answer
93 views
Hello, I implemented the ZoomAndScrollSettings declaratively in my RadChart using XAML (You can see the code snippet in the attached file). The problem is that the Scrollbar to scroll or to zoom isn't displayed in the diagram. Have I forgotten something or did I do something wrong?
Martin Ivanov
Telerik team
 answered on 18 Apr 2019
1 answer
659 views

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.

Vladimir Stoyanov
Telerik team
 answered on 17 Apr 2019
3 answers
155 views

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,

Vladimir Stoyanov
Telerik team
 answered on 17 Apr 2019
4 answers
230 views

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,
                },
......
......
.....

 

Martin Ivanov
Telerik team
 answered on 17 Apr 2019
3 answers
156 views
Hi. I use AStarRouter and FindExtendedRoute. But if the diagram contains many items, it takes a very long time to load. This is especially noticeable when overlaying text on connectors. How I can optimize AStarRouter, for example, by reducing the number of search iterations? Or how I can catch a connection that takes a lot of time in FindExtendedRoute?
Petar Mladenov
Telerik team
 answered on 16 Apr 2019
1 answer
136 views

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

Peshito
Telerik team
 answered on 16 Apr 2019
1 answer
372 views

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,

 

 

Mahdieh
Top achievements
Rank 1
 answered on 15 Apr 2019
6 answers
352 views
Hi, I'd like to know if it would be possible to edit the RadTimeline's template so that I can remove (preferably, if not I'll just hide it) the scroll bar and add the scrolling functionality to the timeline itself, by having the user click and drag on it. Other than that, which PART_ should I apply styles to if I wanted to customize the timeline background? Seems like the examples of customizing cover the TimelineItemTemplate, TimelineInstantItemTemplate and ToolTipTemplate. Thank you!
Martin Ivanov
Telerik team
 answered on 15 Apr 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?