Telerik Forums
UI for WPF Forum
0 answers
133 views

Hello Telerik,

I'm using a RadCartesianChart in WPF allowing a complete customization of the chart.

        <chart:RadCartesianChart x:Name="BarChart"   Visibility="{Binding VisibilityBars, Mode=OneTime}" Grid.ColumnSpan="2">
            <telerik:RadCartesianChart.SmartLabelsStrategy>
                <telerik:ChartSmartLabelsStrategy />
            </telerik:RadCartesianChart.SmartLabelsStrategy>

            <!--Series-->
            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider Source="{Binding Series}"   >
                    <telerik:ChartSeriesDescriptor ItemsSourcePath="DisplayValues"  TypePath="ShapeType" >
                        <telerik:ChartSeriesDescriptor.TypeConverter>
                            <conv:ShapeTypeToSeriesTypeConverter ChartType="Bar"  />
                        </telerik:ChartSeriesDescriptor.TypeConverter>
                    </telerik:ChartSeriesDescriptor> 
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>


            <!--Axes-->
            <chart:RadCartesianChart.HorizontalAxis>
                <chartView:CategoricalAxis x:Name="horizontalAxis"  
									      Title="{Binding HorizontalAxisTitle}"  
                                          />
            </chart:RadCartesianChart.HorizontalAxis>

            <chart:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis x:Name="verticalAxis" 
									      Title="{Binding VerticalAxisTitle}"  
                                          MajorStep="{Binding VerticalAxisMajorStep}" 
									      Minimum="{Binding VerticalAxisMinimum}" 
                                          Maximum="{Binding VerticalAxisMaximum}" 
									      HorizontalLocation="Left" />
            </chart:RadCartesianChart.VerticalAxis>

            <chart:RadCartesianChart.Grid>
                <chartView:CartesianChartGrid MajorLinesVisibility="XY" />
            </chart:RadCartesianChart.Grid>
        </chart:RadCartesianChart>

The chart allows the possibility to custom the series for the PointType and the PointShape. I'm using a ShapeTypeToSeriesTypeConverter class, as below:

Public Class ShapeTypeToSeriesTypeConverter
        Implements IValueConverter
        Public Property ChartType As String


        Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert

            If value Is Nothing OrElse TypeOf (value) IsNot ChartSerieModel.ShapeTypes Then
                Return Nothing
            End If

            Dim ShapeType As ChartSerieModel.ShapeTypes = CType(value, ChartSerieModel.ShapeTypes)
            Select Case ChartType
                Case "Radar"
                    Select Case ShapeType
                        Case ChartSerieModel.ShapeTypes.None
                            Return GetType(RadarPointSeries)

                        Case ChartSerieModel.ShapeTypes.Line, ChartSerieModel.ShapeTypes.DashedLine
                            Return GetType(RadarLineSeries)

                        Case ChartSerieModel.ShapeTypes.Area
                            Return GetType(RadarAreaSeries)

                        Case Else
                            Return Nothing
                    End Select
                Case "Scatter"
                    Select Case ShapeType
                        Case ChartSerieModel.ShapeTypes.None
                            Return GetType(ScatterPointSeries)

                        Case ChartSerieModel.ShapeTypes.Line, ChartSerieModel.ShapeTypes.DashedLine
                            Return GetType(ScatterLineSeries)

                        Case ChartSerieModel.ShapeTypes.Area
                            Return GetType(ScatterAreaSeries)
                        Case Else
                            Return Nothing
                    End Select

                Case Else
                    Select Case ShapeType
                        Case ChartSerieModel.ShapeTypes.None
                            Return GetType(PointSeries)

                        Case ChartSerieModel.ShapeTypes.Line, ChartSerieModel.ShapeTypes.DashedLine
                            Return GetType(StepLineSeries)

                        Case ChartSerieModel.ShapeTypes.Area
                            Return GetType(BarSeries)
                        Case Else
                            Return Nothing
                    End Select
            End Select
        End Function

        Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
            Throw New NotImplementedException()
        End Function
    End Class

 

The problem is on the Else case (BarChart) when I select None shape. I tried with PointSeries and LineSeries because this is the result I want but as you can see in the attached file "none shape.png", the full green serie is hidden.

Excepected result:

  • PointSeries: only the points should be visible, no link
  • LineSeries: the points should be visible and they should be linked by a direct line

Do you know how can I link the points using a direct line (and not the like the StepLineSeries)?

Attached files (here):

  • shape choice.png: example of shapes choice
  • line shape.png: example when the Line shape is selected, and the green serie is correctly displayed

Many thanks.

Valentin M.

Valentin
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 09 Feb 2023
0 answers
206 views

Hello, 

I created a new template for the RadDateTimePicker because I overrided the Clock Part.

As part of the changes I added a Tooltip which shows the date time if not null. In the Watermark control part of the template I show the SelectedValue property that is bound to the ViewModel - TwoWayBinding. The string format of the DateTime is full date: dd/MM/yyyy with full time: HH:mm:ss. So I see the parsed Text on the control. 

I can't find an easy way to show the tooltip in the same format as the display date. I can't set the Tooltio content to RelativeSource Path=SelectedValue because it shows the DateTime in orginal format.

I also can't show in the Tooltio the DisplatText because even if binding OneWay, the date is flickering in every change like binding is wrong.

In the Style of the RadDateTimePicker I have access to SelectedValue, SelectedDateTime,SelectedTime properties but it seems that you convert the Date Time to a text inside the control code because it doesn't work on the Tooltip.

 

Do you have any solution for that?

alex
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 08 Feb 2023
0 answers
219 views

Hi,

I have a window that has a RadPropertyGrid and UserControl that contains five buttons. I want to make the screen full while clicking on maximize button. Now as I have fixed height and width. Maximize button is not working. Can you please help me out.

<Window x:Class="WPF.Views.NoteEdit"
        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"
        xmlns:customcontrol="clr-namespace:WPF.CustomControl"
        xmlns:local="clr-namespace:WPF.Views"
        mc:Ignorable="d"
        x:Name="vwNoteEditWindow"
        Title="NoteEdit" Height="680" Width="750">
    <Grid Height="564" VerticalAlignment="Top" >
        <Grid HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <telerik:RadLayoutControl
                Name="PropertyGridContainer"
                Margin="5"
                VerticalAlignment="Top"
                HorizontalAlignment="Center"              
                BorderThickness="0"
                Orientation="Vertical">
            </telerik:RadLayoutControl>
        </Grid>

        <Grid VerticalAlignment="Bottom">
            <customcontrol:RadPropertyWindowButtons x:Name="ucPropertyButtons" Height="44" VerticalAlignment="Top" HorizontalAlignment="Center" Loaded="RadPropertyWindowButtons_Loaded" CustomCancelClick="btn_Cancel_Click" CustomExitClick="btn_Exit_Click" />
        </Grid>
    </Grid>
</Window>

 

User control :

<UserControl x:Class="WPF.CustomControl.RadPropertyWindowButtons"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:NPTS_WPF.CustomControl"
             xmlns:fa="http://schemas.fontawesome.io/icons/"
             mc:Ignorable="d" 
             d:DesignHeight="45" d:DesignWidth="700">
    <Grid>
        <Grid Uid="radpropertybuttons" Height="39" VerticalAlignment="Bottom" Margin="74,0,-108,0">
            <Button x:Name="btnNormal_Cancel" Margin="0,0,600,10" HorizontalAlignment="Right" Width="80" Height="25" VerticalAlignment="Bottom">
            </Button>

            <Button x:Name="btnNormal_Accept" Margin="0,0,500,10" HorizontalAlignment="Right" Width="80" Height="25" VerticalAlignment="Bottom">
            </Button>

            <Button x:Name="btnNormal_Imperial"  Margin="0,0,370,10" HorizontalAlignment="Right" Width="110" Height="25" VerticalAlignment="Bottom">
            </Button>

            <Button x:Name="btnNormal_Exit" Margin="0,0,270,10" HorizontalAlignment="Right" Width="80" Height="25" VerticalAlignment="Bottom">
            </Button>

            <Button x:Name="btnNormal_Clone" Margin="0,0,170,10" HorizontalAlignment="Right" Width="80" Height="25" VerticalAlignment="Bottom">

            </Button>
        </Grid>

    </Grid>
</UserControl>
Sudeshna
Top achievements
Rank 1
 asked on 06 Feb 2023
1 answer
113 views

The problem I'm seeing is that text does scale up or down, just sometimes it seems to jump to a large size - is this a feature of RadDiagram? I note that if I set the scale back to 100%, the text is now much bigger. I've attached pictures to demonstrate.

now zoom out:

the text is bigger, to be readable? Now go back to 100%:

the text is now huge.

Pete
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 06 Feb 2023
0 answers
87 views

I have this property

private double? _netFreqValue;
public double? NetFreqValue
{
    get => _netFreqValue;
    set
    { 
        if(_netFreqValue == value) return;
        _netFreqValue = value;
        this.OnPropertyChanged();
    }
}

and im trying to set the EmptyContent property to nothing(empty string) when the value is null

this works fine

<RadMaskedNumericInput
    Mask = "#4.3"
    AllowInvalidValues = "False"
    EmptyContent = ""
    UpdateValueEvent = "LostFocus"
    Value = "{Binding NetFreqValue, Mode=TwoWay, UpdateSourceTrigger = PropertyChanged}" />

but this does not

<RadMaskedNumericInput

    Mask = "#4.3"
    AllowInvalidValues = "False"
    EmptyContent = ""
    UpdateValueEvent = "LostFocus">
    <RadMaskedNumericInput.Value>
        <Binding Path=""NetFreqValue"
                         UpdateSourceTrigger="PropertyChanged"
                          Mode="TwoWay">
            <Binding.ValidationRules>
              //some validations
             </Binding.ValidationRules>
        </Binding>
      </RadMaskedNumericInput.Value>
</RadMaskedNumericInput>

how can i solve it?
thanks
ofir
Top achievements
Rank 1
 asked on 01 Feb 2023
0 answers
157 views

There are images for the ribbon for open, save, etc, and I was wondering if I'm allowed to use them...

 

BENN
Top achievements
Rank 1
 asked on 01 Feb 2023
1 answer
485 views

I"m following example for context menu in grid view:

https://docs.telerik.com/devtools/wpf/controls/radcontextmenu/how-to/use-radcontextmenu-with-radgridview

Sample grid view has context menu on clicking record: Add/Edit/Delete.

Need advice how to create dynamic context menu on-the-fly based on selected row, using parent-child nodes approach like:

- Notify Option1

      - client 1

      - client 2

      - client <...> (items number is variable based on selected row)

- Notify Option2

      - department1

      - department2

      - department<...> (variable)

- Delete

I'm wonder if it is possible to populate menu items in Click_Row() event instead of static init process this.InitializeRowContextMenuItems();

Another approach would be creating separate dialog inside Click_Row() listing all items for each category "Notify Option1", "Notify Option2". But dynamic menu context looks more clean approach.

 

Martin Ivanov
Telerik team
 answered on 01 Feb 2023
0 answers
101 views

Hi,

I would like to highlight a cell (C1) in yellow if the value in another cell (B1) is true.

I have tried typing in B1 or =B1 in the box in the screenshot below "Format cell values where this formula is true:" but C1 is always yellow.

Can someone point me in the right direction?

Regards

Anthony

 

Anthony
Top achievements
Rank 1
Iron
Veteran
 asked on 01 Feb 2023
0 answers
150 views

Hello,

I followed your tutorial to use the RadDataPager and RadGridView. The pager is bound to the view model source items and the Rad Grid View is bound to the RadDataPager. See the following example:

 

<Grid x:Name="LayoutRoot" 
        Background="White">     
    <Grid.RowDefinitions> 
        <RowDefinition /> 
        <RowDefinition Height="Auto" /> 
    </Grid.RowDefinitions> 
    <telerik:RadGridView x:Name="radGridView" 
                         ItemsSource="{Binding PagedSource, ElementName=radDataPager}" 
                         AutoGenerateColumns="False"> 
        <telerik:RadGridView.Columns> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" /> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyName}" /> 
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}" /> 
        </telerik:RadGridView.Columns> 
    </telerik:RadGridView> 
    <telerik:RadDataPager x:Name="radDataPager" 
                          Source="{Binding Employees}" 
                          PageSize="5" /> 
</Grid> 

 

I can see that the pager splits the items into pages of 50 items (I have 10 pages) but the RadGridView shows all the items. Only if I force the reload of the xaml (with Hot Reload), the RadGridView is updated according to the pager items in the current page, until that point all the items are shown.

What am I doing wrong?

alex
Top achievements
Rank 2
Bronze
Iron
Iron
 asked on 31 Jan 2023
2 answers
137 views

Hey, I have using your control RadMenuGroupItem with ItemsSource that is Observable Collection of string. I noticed that for name with underscore in them, the underscore is removed from the name. Here an example:

telerik_123 will turn to telerik123

I use the same ItemsSource in a RadComboBox and in there I don't have this issue.

What can I do to solve this?

Sincerely, Omer 

Ralitsa
Telerik team
 answered on 31 Jan 2023
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
VirtualKeyboard
HighlightTextBlock
Security
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?