Telerik Forums
UI for WPF Forum
1 answer
182 views

Hello,

I'm currently evaluation the chart control and tried to draw a spline line. The result looks odd (see attached screenshot). I would expect a line as shown in the second attachment.

These are the point of spline:

this.DataContext = new List<ChartData>()
{
new ChartData { XVal = 1, YVal = 0.2 },
new ChartData { XVal = 2, YVal = 0.259 },
new ChartData { XVal = 15, YVal = 2.884 },
new ChartData { XVal = 25, YVal = 5.15 },
new ChartData { XVal = 40.3, YVal = 8.73 },
new ChartData { XVal = 50, YVal = 9.9 },
};

It seems there is a problem with the slope. Is there a way to set the start slope?

Best Regards

Olaf

 

Petar Marchev
Telerik team
 answered on 26 Apr 2016
2 answers
296 views

Hi, I am using telerik:RadCartesianChart in my UI. But I can't control the alignment of the vertical labels.

My code looks like this:

================================================================================================

            <Style x:Key="BarLabelTextStyle" TargetType="TextBlock">
                <Setter Property="FontFamily" Value="Segoe UI" />
                <Setter Property="HorizontalAlignment" Value="Center"></Setter>
                <Setter Property="Width" Value="40"></Setter>
            </Style>

<telerik:RadCartesianChart x:Name="BarChart" Grid.Row="1"
                                       VerticalAlignment="Stretch"
                                       HorizontalAlignment="Stretch">
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:CategoricalAxis GapLength="0.4"
                                             LabelFitMode="Rotate"
                                             ShowLabels="True"
                                             SmartLabelsMode="SmartStep"
                                             LabelStyle="{StaticResource BarLabelTextStyle}"
                                             PlotMode="OnTicksPadded" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis Maximum="{Binding MaxCount}"
                                        Minimum="{Binding MinCount}"
                                        ShowLabels="True"
                                        LabelStyle="{StaticResource BarLabelTextStyle}" />
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
                </telerik:RadCartesianChart.Grid>
                <telerik:BarSeries CategoryBinding="Name"
                                   ValueBinding="Proportion"
                                   ItemsSource="{Binding CheckedListItems}"
                                   ShowLabels="{Binding LabelEnabled}"
                                   CombineMode="Cluster"
                                   IsHitTestVisible="True">
                    <telerik:BarSeries.PointTemplate>
                        <DataTemplate>
                            <Border
                                Background="{Binding DataItem, Converter={StaticResource SliceToBarBrushConverter}}"
                                MouseEnter="BarElement_MouseEnter"
                                MouseLeave="BarElement_MouseLeave" />
                        </DataTemplate>
                    </telerik:BarSeries.PointTemplate>
                </telerik:BarSeries>
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartTrackBallBehavior />
                    <telerik:ChartPanAndZoomBehavior x:Name="ZoomPanBehavior" ZoomMode="None" PanMode="None"
                                                     DragMode="Pan" />
                    <telerik:ChartSelectionBehavior DataPointSelectionMode="Multiple" HitTestMargin="2"
                                                    SelectionChanged="BarChartSelectionBehavior_SelectionChanged" />
                </telerik:RadCartesianChart.Behaviors>
            </telerik:RadCartesianChart>

================================================================================================

Changing the BarLabelTextStyle HorizontalAlignment is not affecting anything for bar labels.

The result looks like from attachment. You can see that the first bar chart's vertical labels are too far away from axis. And the second bar chart's labels are too close to the first bar chart, comparing to it's own axis.

Is there something I can do here?

Thanks.

 

 

Mingxue
Top achievements
Rank 1
 answered on 25 Apr 2016
1 answer
120 views

Hi all,

I have successfully applied the VisualStudio2013 theme to the panelBar using implicit styling. However, I am still unable to figure out how to apply the VisualStudio2013_Dark Theme. Can anyone help me with this?

I have attached the sample program I used to try on.

 

<Application x:Class="MapSetUp.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

<UserControl x:Class="Telerik.Windows.Examples.PanelBar.FirstLook.Example"
        xmlns:local="clr-namespace:Telerik.Windows.Examples.PanelBar.FirstLook"
         
        HorizontalAlignment="Center" VerticalAlignment="Center">
    <UserControl.Resources>
        <local:MainPageViewModel x:Key="myViewModel" />
    </UserControl.Resources>
 
    <Grid>
        <Grid x:Name="LayoutRoot"  Width="766" Height="360" HorizontalAlignment="Center" VerticalAlignment="Center"
                Background="White" DataContext="{StaticResource myViewModel}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="220" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <telerik:RadPanelBar x:Name="radPanelBar" VerticalAlignment="Stretch"
                    BorderBrush="#FFCBD8E8" BorderThickness="1 1 0 1"
                    SelectedItem="{Binding SelectedCategory, Mode=TwoWay}"
                    SelectionChanged="radPanelBar_SelectionChanged">
                <telerik:RadPanelBarItem IsExpanded="True">
                    <telerik:RadPanelBarItem.Header>
                        <TextBlock Text="Academic Staff" Margin="5 3" />
                    </telerik:RadPanelBarItem.Header>
                    <ListBox ItemsSource="{Binding Employees}" BorderThickness="0" BorderBrush="Transparent"
                            SelectedItem="{Binding SelectedEmployee, Mode=TwoWay}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                                    <Border Margin="10 5 15 5" BorderBrush="#FFA1A1A1"
                                            BorderThickness="1">
                                        <Image Source="{Binding SmallImagePath}" Stretch="None" />
                                    </Border>
                                    <TextBlock VerticalAlignment="Center" FontFamily="Segoe UI"
                                            Text="{Binding Name}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem>
                    <telerik:RadPanelBarItem.Header>
                        <TextBlock Text="Programs" Margin="5 3" />
                    </telerik:RadPanelBarItem.Header>
                    <ListBox ItemsSource="{Binding WeekDays}" BorderThickness="0" BorderBrush="Transparent">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <CheckBox Margin="10 5 5 5"
                                        Command="{Binding DayCheckedCommand, Source={StaticResource myViewModel}}"
                                        Content="{Binding Header}"
                                        IsChecked="{Binding IsChecked, Mode=TwoWay}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem >
                    <telerik:RadPanelBarItem.Header>
                        <TextBlock Text="Selected Publications" Margin="5 3" />
                    </telerik:RadPanelBarItem.Header>
                    <ListBox ItemsSource="{Binding PublicationPeriods}" BorderThickness="0" BorderBrush="Transparent">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <CheckBox Margin="10 5 5 5"
                                        Command="{Binding PublicationCheckedCommand, Source={StaticResource myViewModel}}"
                                        Content="{Binding Header}"
                                        IsChecked="{Binding IsChecked, Mode=TwoWay}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem>
                    <telerik:RadPanelBarItem.Header>
                        <TextBlock Text="Contact Information" Margin="5 3" />
                    </telerik:RadPanelBarItem.Header>
                </telerik:RadPanelBarItem>
            </telerik:RadPanelBar>
            <Border Grid.Column="1" BorderBrush="#FFCBD8E8"
                    BorderThickness="1">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Margin="10" Background="#FFF9F9F9">
                        <Grid Margin="15 10" DataContext="{Binding SelectedEmployee}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
 
                            <Grid Margin="0 0 0 5">
                                <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center"
                                        FontFamily="Segoe UI" FontSize="16" FontWeight="Bold"
                                        Foreground="#FF1E395B" Text="{Binding Department}" />
                                <Image HorizontalAlignment="Right"
                                        Source="Images/PanelBar/Printer.png" Stretch="None" />
                            </Grid>
                            <Border Height="1" VerticalAlignment="Bottom" Background="#FFA0AFC3">
                                <Border.OpacityMask>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                                        <GradientStop Offset="1" />
                                        <GradientStop Offset="0.5" Color="White" />
                                    </LinearGradientBrush>
                                </Border.OpacityMask>
                            </Border>
 
                            <Grid Grid.Row="1" Margin="0 10 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Border Grid.RowSpan="3" Margin="10 5 15 5" BorderBrush="#FFA1A1A1"
                                        BorderThickness="1">
                                    <Image Source="{Binding LargeImagePath}" Stretch="None" />
                                </Border>
                                <TextBlock Grid.Column="1" Margin="10 3 20 10"
                                        HorizontalAlignment="Left" FontFamily="Segoe UI"
                                        Text="Name:" TextAlignment="Right" />
                                <TextBlock Grid.Column="2" HorizontalAlignment="Left"
                                        FontFamily="Segoe UI" FontSize="16" Foreground="#FF1E395B"
                                        Text="{Binding Name}" />
                                <TextBlock Grid.Row="1" Grid.Column="1" Margin="10 3 20 10"
                                        HorizontalAlignment="Left" FontFamily="Segoe UI"
                                        Text="Position:" TextAlignment="Right" />
                                <StackPanel Grid.Row="1" Grid.Column="2" Margin="0 0 0 10">
                                    <TextBlock HorizontalAlignment="Left" FontFamily="Segoe UI"
                                            FontSize="13.333" FontWeight="Bold"
                                            Foreground="#FF4C607A" Text="{Binding Position}" />
                                    <TextBlock Width="309" Margin="0 10 0 0"
                                            HorizontalAlignment="Left" FontFamily="Segoe UI"
                                            FontSize="12" Text="{Binding PositionAdditionalInfo}"
                                            TextWrapping="Wrap" />
                                </StackPanel>
                                <TextBlock Grid.Row="2" Grid.Column="1" Margin="10 2 20 0"
                                        HorizontalAlignment="Left" FontFamily="Segoe UI"
                                        Text="Office:" TextAlignment="Right" />
                                <TextBlock Grid.Row="2" Grid.Column="2" Width="309"
                                        HorizontalAlignment="Left" FontFamily="Segoe UI"
                                        FontSize="12" Text="{Binding Office}" TextWrapping="Wrap" />
                            </Grid>
 
                        </Grid>
                    </Border>
                    <StackPanel Grid.Row="1" Margin="25 10">
                        <TextBlock Margin="0 0 0 10" HorizontalAlignment="Left"
                                FontFamily="Segoe UI" FontSize="13" FontWeight="Bold"
                                Foreground="#FF1E395B" Text="{Binding AdditionalInfoType}" />
                        <TextBlock FontFamily="Segoe UI" Text="{Binding AdditionalInfo}"
                                TextWrapping="Wrap" />
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>
    </Grid>
    <!--<telerikQuickStart:QuickStart.ConfigurationPanel>
        <StackPanel Margin="3">
            <RadioButton Margin="0 2" Checked="OnRadioButtonClick" Content="Single ExpandMode"
                    IsChecked="true" Unchecked="OnRadioButtonClick" />
            <RadioButton Margin="0 2" Content="Multiple ExpandMode" />
        </StackPanel>
    </telerikQuickStart:QuickStart.ConfigurationPanel>-->
</UserControl>

Regards,

Vincent

Martin
Telerik team
 answered on 25 Apr 2016
3 answers
209 views

I am trying to find a solution to display only unique members in the rad data filter. For ex I have a class Employee with 3 properties Name, Age, Address. User clicks on the + sign and in the first filter editor selects Name. Then user adds another filter editor, in this one i do not want to display Name property similarly if user selects age in the second one, I want to remove age option from the first filter and not have that in other editors.

I am reading some posts about SimpleFilterMemberComboBox and how to manipulate the available members items, but that looks very compilcated, Just wondering if there is some easy option for this.

Vikas
Top achievements
Rank 1
 answered on 25 Apr 2016
3 answers
195 views

Hi! I try to use RadDataForm in my WPF MVVM Prism 6 application. Since I began to use this control I've collided with some problems - data from form is not passed into properies of the object to which RadDataForm is bound. Below is the class to object of which RadDataForm is bound:

public class Group : IEditableObject
{
   struct GroupData
   {
      internal string name;
   }
 
   private GroupData _newGroupData;
   private GroupData _backupGroupData;
   private bool _isEditMode = false;
 
   public Group()
   {
      this._newGroupData = new GroupData();
      this._newGroupData.name = string.Empty;
   }
   public string Name
   {
      get { return this._newGroupData.name; }
      set { this._newGroupData.name = value; }
   }
 
   public void BeginEdit()
   {
      if(!this._isEditMode)
      {
         this._backupGroupData = this._newGroupData;
         this._isEditMode = true;
      }
   }
 
   public void CancelEdit()
   {
      if (this._isEditMode)
      {
         this._newGroupData = this._backupGroupData;
         this._isEditMode = false;
      }
   }
 
   public void EndEdit()
   {
      if (this._isEditMode)
      {
         this._backupGroupData = new GroupData();
         this._isEditMode = false;
      }
   }
 
   public override string ToString()
   {
      StringWriter stringWriter = new StringWriter();
      stringWriter.Write(this.Name);
      return stringWriter.ToString();
   }
}

Then in view model:

private Group _profileElementsGroup;
public Group ProfileElementsGroup
{
    get { return this._profileElementsGroup; }
    set { this.SetProperty(ref this._profileElementsGroup, value); }
}

Then in XAML of view:
<Grid.Resources>
  <DataTemplate x:Key="GroupTemplate">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <telerik:DataFormDataField Grid.Row="0" Label="GroupName" DataMemberBinding="{Binding ProfileElementsGroup.Name, Mode=TwoWay}"/>
    </Grid>
  </DataTemplate>
</Grid.Resources>
 
<telerik:RadDataForm HorizontalAlignment="Center" VerticalAlignment="Top"
                             AutoGenerateFields="False" Header="Add Element Group of Profile of Device" ReadOnlyTemplate="{StaticResource GroupTemplate}"
                             EditTemplate="{StaticResource GroupTemplate}" CurrentItem="{Binding ProfileElementsGroup}">
            <telerik:EventToCommandBehavior.EventBindings>
                <telerik:EventBinding
                    Command="{Binding HandleEndEditNewProfileElementsGroupCommand}"
                    EventName="EditEnded"
                    PassEventArgsToCommand="True"/>
            </telerik:EventToCommandBehavior.EventBindings>
</telerik:RadDataForm>

 

When I printing in my RadDataForm in Name field I set breakpoint in C# code of Name property and this breakpoint is not activated. So data from RadDataForm doesn't fall into ProfileElementsGroup.Name property. What I do wrong? Please help.

Eugene
Top achievements
Rank 1
 answered on 25 Apr 2016
1 answer
98 views

Can anyone point me to an example of how to place custom pins on a map? I've seen demos and other examples that do exactly what I'm looking for but none of them give any code or explanation of how to do the pins.

 

I've attached a screen shot of what I'm looking for.

 

Thanks in advance

Ivan
Telerik team
 answered on 25 Apr 2016
2 answers
93 views

Allow docking a floating window without making the pane take the whole space (Just like in visual studio).

 

Nasko
Telerik team
 answered on 25 Apr 2016
1 answer
661 views

When processing the SelectionChanged event for a RadComboBox, the Text property of the control is not yet set with the new text value. For example, we add a RadComboBox with the SelectionChanged event set to the following OnSelectionChanged.

private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
    RadComboBox cb = sender as RadComboBox;
    Trace.TraceInformation("cb.Text = {0}", cb.Text);
}

When we start typing in the Combo Box, the displayed text is always the Text value before the latest character. So,l when we type 1, cb.Text is null, when we type 2, the combo box displays "12", but cb.Text is 1.

How can we see the current value of the text box when the selection is changed?

Yana
Telerik team
 answered on 25 Apr 2016
5 answers
121 views
Hi,

We are migrating some existing systems to WPF and when I try "-0" with the RadDatePicker, The whole application crashed immediately without further error message etc. Is this a bug of the control? Would this be fixed in the next patch or release?

PS. We are testing with version Q3 2009 SP1 and "-0" is one of the shortcut keys of our existing system.

Thanks,
John
Yana
Telerik team
 answered on 25 Apr 2016
2 answers
125 views

Hi,

I am running the following xaml:

<Grid><br>        <telerik:RadRibbonView telerik:KeyTipService.IsKeyTipsEnabled="True"><br>            <telerik:RadRibbonView.ApplicationMenu><br>                <telerik:ApplicationMenu telerik:KeyTipService.AccessText="F"><br>                    <telerik:RadRibbonButton Content="New" telerik:KeyTipService.AltAccessText="N"/><br>                </telerik:ApplicationMenu><br>            </telerik:RadRibbonView.ApplicationMenu><br>        </telerik:RadRibbonView><br>    </Grid><br>

 

When I do "Alt+F", it opens the main menu like it should, but then if I press "N" alone, it clicks the button but does not close the application menu (and the access key disappears too). If I press "Alt+N", it closes the application menu promptly. My question is how do I close the application menu on just "N" alone?

Any ideas?

Best

Usman
Top achievements
Rank 1
 answered on 22 Apr 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?