Telerik Forums
UI for WPF Forum
7 answers
523 views
Hi,

 

I am using the sample from Telerik Demo to create pie chart, and register to .LayoutUpdate event, at which doing following:

        private void pieChart_LayoutUpdated(object sender, System.EventArgs e)
        {
            var paths = ChildrenOfTypeExtensions.ChildrenOfType<Path>(PieChart.Series[0]).ToList();
            if (paths.Count == 0)
                return;
            PieChart.LayoutUpdated -= pieChart_LayoutUpdated;
            foreach (var path in paths)
            {
                var dataPoint = path.Tag as PieDataPoint;
                if (dataPoint == null)
                    return;
                    path.MouseEnter += uiElement_MouseEnter;
                    path.MouseLeave += uiElement_MouseLeave;
            }
        }
        private void uiElement_MouseEnter(object sender, MouseEventArgs e)
        {
            var bar = (UIElement) sender;
            bar.Opacity = 0.5;
        }
        private void uiElement_MouseLeave(object sender, MouseEventArgs e)
        {
            var bar = (UIElement)sender;
            bar.Opacity = 1;
        }
 

But I wanted more than just highlighting on pie "path", I want the associated label to be highlighted too.

Which at the moment, I am doing something like this:

        <Style x:Key="SlicerNameTextBoxStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{Binding DataItem, Converter={StaticResource SlicerToBrushConverter}}"></Setter>
            <Setter Property="FontWeight" Value="{Binding DataItem, Converter={StaticResource SlicerToNameConverter}}"></Setter>
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{StaticResource MouseOverBrush}"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

                <telerik:PieSeries.LabelDefinitions>
                    <telerik:ChartSeriesLabelDefinition Margin="-4,0,0,0"
                                                        DefaultVisualStyle="{StaticResource SlicerNameTextBoxStyle}">
                        <telerik:ChartSeriesLabelDefinition.Template>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock Text="{Binding DataItem.DisplayName}"
                                               HorizontalAlignment="Center"
                                               Style="{StaticResource SlicerNameTextBoxStyle}"
                                               MouseDown="SlicerPieLabel_OnMouseDown"/>
                                </StackPanel>
                            </DataTemplate>
                        </telerik:ChartSeriesLabelDefinition.Template>
                    </telerik:ChartSeriesLabelDefinition>
                </telerik:PieSeries.LabelDefinitions>

 

As you can see, the problem is that I can't connect the pie slice and label highlight together, and I duplicated the pie selection changed event.

Can you help me to provide a better solution here?

Thanks,

Mingxue

 

Petar Marchev
Telerik team
 answered on 31 May 2016
1 answer
111 views

I have a child RadGridview contained in the row details of a master RadGridView defined through a data template .

Each row of the child RadGridview has an active checkbox bound to a viewmodel.  

If a child checkbox  is checked , as the master RadGridView is scrolled to hide the details of a row and then back again , that checkbox returns unchecked.

The viewmodel still shows the value as checked.

Any help would be appreciated.

 

 

 

Dilyan Traykov
Telerik team
 answered on 30 May 2016
7 answers
104 views
I have a RadGridView which contains several columns. I have Sum function for part of the columns which show decimal number. Now when I drag the columns which do not have Sum function that can show the Count function result, how to archive this? Just add Count function to those columns will show both of the result.
Dilyan Traykov
Telerik team
 answered on 30 May 2016
1 answer
204 views
The documentation for RadSpreadsheet says that it supports PixelBased scrolling. How do I enable this? I tried setting the attached property ScrollViewer.CanContentScroll = False, but it doesn't appear to have worked.
Tanya
Telerik team
 answered on 30 May 2016
1 answer
92 views

RadScheduleView: clipping appointment name in Edit mode.

Hi, I need the appointment name in the schedule control to auto-expand to fit whatever the name of the appointment is. This is most troublesome in Edit mode, I get something like "This is the na..." - the rest of the name is clipped in the scheduler grid.

Please advise with a work-around.

Telerik.Windows.Controls.dll v. 2016.1.217.40

Barry

Yana
Telerik team
 answered on 30 May 2016
1 answer
200 views

Hello,

I'm following this document and are able to create the child gridview.

http://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/basic-hierarchies

My need now is I want to have a double click event tied to the child gridview then get the parent row data (object).

Are there any sample codes or guidance?

Thanks,

Brew

 

Dilyan Traykov
Telerik team
 answered on 30 May 2016
7 answers
150 views

A peculiar behavior we have found with the RadCalendar control:

We have a custom DayButtonStyleSelector set to an instance of a RadCalendar. This StyleSelector sets the Visibility of days that do not belong to the month displayed as Collapsed, instead of being grayed out as they normally would be.

Furthermore, we dynamically change the number of columns displayed dependent on the width available to the RadCalendar.

The StyleSelector works as intended when loading the Calendar and when increasing the column count, but when we reduce the column count by reducing the space available for the RadCalendar control, the last column seems to ignore the StyleSelector and displays the days of the following month in grey.

However, using Snoop we found out that the Style is applied - and consequently overridden by a locally set Visibility.

This only happens for the last column, and only when reducing the number of columns. Please see the attached screenshots (1.jpg shows the Calendar after loading, 2.jpg shows the calendar after expanding enough to display a third column, 3.jpg shows the calendar after reducing it back to 2 columns).

A code sample to illustrate this problem:

 

<Window x:Class="MainWindow"
       Title="MainWindow" Height="200" Width="400">
    <telerik:RadCalendar VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="cal" />
</Window>

 

And the code behind (please excuse the VB.Net):

 

Imports Telerik.Windows.Controls.Calendar
Class MainWindow
    Private Const MinCalendarWidth = 150
    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
        cal.DayButtonStyle = Nothing
        cal.DayButtonStyleSelector = New CDayStyleSelector()
    End Sub
    Protected Overrides Sub OnRenderSizeChanged(sizeInfo As SizeChangedInfo)
        MyBase.OnRenderSizeChanged(sizeInfo)
        Dim CalendarColumns = Math.Max(1, CInt(Math.Floor(sizeInfo.NewSize.Width / MinCalendarWidth)))
        If cal.Columns <> CalendarColumns Then
            cal.Columns = CalendarColumns
        End If
    End Sub
    Private Class CDayStyleSelector
        Inherits StyleSelector
        Private _HideButtonStyle As New Style
        Public Sub New()
            _HideButtonStyle.Setters.Add(New Setter(VisibilityProperty, Visibility.Collapsed))
        End Sub
        Public Overrides Function SelectStyle(item As Object, container As DependencyObject) As Style
            Dim Content = TryCast(item, CalendarButtonContent)
            If Content IsNot Nothing AndAlso Content.ButtonType = CalendarButtonType.Date Then
                If Not Content.IsFromCurrentView OrElse Content.IsInAnotherView Then
                    Return _HideButtonStyle 'Hide all Buttons of other months
                End If
            End If
            Return MyBase.SelectStyle(item, container)
        End Function
    End Class
End Class

 

You can observe the problem described by changing the width of the window.

Kalin
Telerik team
 answered on 30 May 2016
1 answer
345 views

Hey,

 

I'm trying to create RadCartesianChart that on VerticalAxis and HorizontalAxis have DateTimeCategoricalAxis.

In the HorizontalAxis should be the date and in the VerticalAxis should be the Hours and Minutes.

Attached my view, I'm working on it over a week and still can't find the answer to this issue.

<------------------------------------------------>

  <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <telerik:RadLegend x:Name="legend1"
                           HorizontalAlignment="Right"
                           Width="100"
                           Items="{Binding LegendItems, ElementName=Chart1}"
                           Style="{DynamicResource RadLegendStyle1}"
                           Margin="0,239.5,0,215.5">
            <telerik:RadLegend.ItemTemplate>
                        <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                        <Border Width="12"
                        Height="3"
                        BorderBrush="Black"
                        CornerRadius="0"
                        Background="{Binding MarkerFill}" />

                        <TextBlock Margin="2"
                        Text="{Binding Title}" />
                        </StackPanel>
                        </DataTemplate>
            </telerik:RadLegend.ItemTemplate>
        </telerik:RadLegend>
        <telerik:RadCartesianChart x:Name="Chart1"
                                   Grid.Column="1"
                                   Palette="{StaticResource customPalette}"
                                   Style="{DynamicResource StyleRadCartesianChartSeriesPoint}">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="dd - MM - yy"
                                                 DateTimeComponent="Month"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="HH : mm" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
            </telerik:RadCartesianChart.Grid>
            <telerik:PointSeries PointTemplate="{StaticResource PointTemplate2}"
                                 ItemsSource="{Binding valueBarPoints}"
                                 CategoryBinding="Datee"
                                 ValueBinding="Time">
                <!--<telerik:PointSeries.DataPoints>
                    <telerik:CategoricalDataPoint Category="January"
                                                  Value="4" />
                    <telerik:CategoricalDataPoint Category="February"
                                                  Value="7" />
                    <telerik:CategoricalDataPoint Category="March"
                                                  Value="5" />
                    <telerik:CategoricalDataPoint Category="April"
                                                  Value="6" />
                    <telerik:CategoricalDataPoint Category="May"
                                                  Value="12" />
                    <telerik:CategoricalDataPoint Category="June"
                                                  Value="9" />
                    <telerik:CategoricalDataPoint Category="July"
                                                  Value="3" />
                </telerik:PointSeries.DataPoints>-->
                <telerik:PointSeries.LegendSettings>
                    <telerik:SeriesLegendSettings Title="List 2" />
                </telerik:PointSeries.LegendSettings>
            </telerik:PointSeries>

        </telerik:RadCartesianChart>

    </Grid>

<--------------------------------------------------->

 

 

 

Thanks,

Hila.

Petar Marchev
Telerik team
 answered on 30 May 2016
1 answer
188 views
Hi, I want to save a RadDiagram to a file just when it changed. How to know the RadDiagram has changed? like isDirty property
Dinko | Tech Support Engineer
Telerik team
 answered on 27 May 2016
4 answers
205 views

Hi,

I would like to know how we can have a horizontal scroll for the RadTimeline. The error is shown displayed on the line "<telerik:SelectionRange`1 End="1" Start="0"/>" which is part of the RadTimeline template. I have attached the screenshot of how the timeline looks currently.

Regards,

Rajeswari

Rajeswari
Top achievements
Rank 1
 answered on 27 May 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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?