Telerik Forums
UI for WPF Forum
7 answers
509 views
Hi.

I use the property editor and want almost all of the properties to be auto generated, because they are dynamically loaded from available modules. But there are some properties, which should be generated as nested properties, so I define them in code like this:

01.private PropertyDefinition GetOperationTimePropertyDefinition(List<OperationTime> times)
02.{
03.    var definition = new PropertyDefinition();
04. 
05.    int order = 1;
06.    foreach (var operationTime in times)
07.    {
08.        var binding = new Binding { Source = operationTime, Path = new PropertyPath("")};
09.         
10.        var nestedPropertyDefinition = new PropertyDefinition
11.                                        {
12.                                            DisplayName = operationTime.DayOfWeek,
13.                                            OrderIndex = order++,
14.                                            Binding = binding,
15.                                            EditorTemplate = FindResource("OperationTimeEditorTemplate") as DataTemplate
16.                                        };
17. 
18.        definition.NestedProperties.Add(nestedPropertyDefinition);
19.    }
20. 
21.    return definition;
22.}

The result you can see on the attached screenshot, the properties are generated correctly, but the binding made in line 8 is not working.
I am getting this binding exceptions:

System.Windows.Data Error: 40 : BindingExpression path error: 'WorkStartTillPause' property not found on 'object' ''PropertySetViewModel' (HashCode=37731737)'. BindingExpression:Path=WorkStartTillPause; DataItem='PropertySetViewModel' (HashCode=37731737); target element is 'RadTimePicker' (Name=''); target property is 'SelectedValue' (type 'Nullable`1')


Can you tell me how to construct the binding to get this work?
tarnegur
Top achievements
Rank 1
 answered on 29 Dec 2014
1 answer
111 views
Hey All,

I am using RadDiagram for displaying selectedObject is a row in database and its parents and childs .I need counting parent and child for selectedObject.I need an aprroach can ı do it in view or ı need to configure with viewmodel(I am deeveloping MVVM) . I need all diagram will be dynamic for me .


I wish ı could explain my issue . Best Regards
Peshito
Telerik team
 answered on 26 Dec 2014
1 answer
65 views
Hi All, 
In WPF  RadChart , how can I set labels in a BubbleSeriesDefinition, to contain bubble size not yValues.   
Regards
Petar Marchev
Telerik team
 answered on 26 Dec 2014
7 answers
215 views
When you select a shape that is near the right edge of the diagram surface, the toggle button to show the SettingsPaneView is outside of the Diagram/Window, and therefore not accessible (I have limited it to the Page Size, so you cannot move any further to the right).

Is there any way to Keep it in view, showing above the selected shape if necessary?

Alex
Martin Ivanov
Telerik team
 answered on 26 Dec 2014
1 answer
209 views
<telerik:RadCatresianChart x:Name="cartesianChart">
    <radchartview:RadCartesianChart.Behaviors>
        <chartview:ChartTrackBallBehavior ShowIntersectionPoints="True" />
    </radchartview:RadCartesianChart.Behaviors>
    <radchartview:RadCartesianChart.Annotations>
    <chartview:CartesianGridLineAnnotation Value="{Binding CurrentDate}" Axis="{Binding ElementName=horizontalAxis}" Stroke="Black" StrokeThickness="2">
        </chartview:CartesianGridLineAnnotation>
    </radchartview:RadCartesianChart.Annotations>
     <telerik:RadCartesianChart.SeriesProvider>
     <telerik:ChartSeriesProvider Source="{Binding SuppChart}">
          <telerik:ChartSeriesProvider.SeriesDescriptors>
              <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" ValuePath="CurrentValue" CategoryPath="Date">
                  <telerik:CategoricalSeriesDescriptor.Style>
                      <Style TargetType="chartview:LineSeries">
                           <Setter Property="StrokeThickness" Value="2"/>
                           <Setter Property="ShowLabels" Value="{Binding ShowLabels}" />
                           <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BoolToVis}}" />
                           <Setter Property="LegendSettings">
                               <Setter.Value>
                                   <telerik:SeriesLegendSettings Title="{Binding Label}"/>
                               </Setter.Value>
                            </Setter>
                            <Setter Property="Stroke" Value="{Binding Color}" />
                            <Setter Property="VerticalAxis" Value="{Binding VerticalAxis}"/>
                        </Style>
                    </telerik:CategoricalSeriesDescriptor.Style>
                </telerik:CategoricalSeriesDescriptor>
            </telerik:ChartSeriesProvider.SeriesDescriptors>
        </telerik:ChartSeriesProvider>
    </telerik:RadCartesianChart.SeriesProvider>
    <radchartview:RadCartesianChart.HorizontalAxis>
        <chartview:DateTimeContinuousAxis x:Name="horizontalAxis" PlotMode="BetweenTicks" ShowLabels="True" LabelFormat="{Binding AxisLabel}" MajorTickStyle="{StaticResource tickStyle}" LabelFitMode="Rotate" Minimum="{Binding StartDate}" Maximum="{Binding EndDate}"/>
    </radchartview:RadCartesianChart.HorizontalAxis>
</telerik:RadCatresianChart>

This is my XAML code. When I change the SuppChart collection (ObservableCollection) the chart isn't render the horizontal axis and annotation. I implement INotifyPropertyChanged and INotifyCollectionChanged. Data are render properly after collection change.

I attached picutures of plot before and after refresh the data. 

What can be wrong? I missing something?
Peshito
Telerik team
 answered on 26 Dec 2014
1 answer
75 views
here is the xaml:
<telerik:RadCartesianChart x:Name="Chart">
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
           
            <telerik:RadCartesianChart.Series>
                <telerik:ScatterPointSeries XValueBinding="Category" YValueBinding="Value" ItemsSource="{Binding}">
                    <telerik:ScatterPointSeries.PointTemplate>
                        <DataTemplate>
                            <Ellipse Width="10" Height="10" Fill="{Binding DataItem.Color}"/>
                        </DataTemplate>
                    </telerik:ScatterPointSeries.PointTemplate>
                </telerik:ScatterPointSeries>
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>

the binding code is:
public MainWindow()
        {
            InitializeComponent();
            DataContext = GetData(12);
        }        public static List<ChartData> GetData(int dataSize)
        {
            Random rnd = new Random();
            var result = new List<ChartData>();            for (int i = 0; i <= dataSize; i++)
            {
                result.Add(new ChartData()
                {
                    Category = i,
                    Value = rnd.Next(1, 100),
                    Color = new SolidColorBrush(
                        Color.FromArgb(255, (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256)))
                });
            }            return result;
        }

but when running app. the points is not show. pls Help.
     
Petar Marchev
Telerik team
 answered on 25 Dec 2014
3 answers
489 views
hello,

how can I load an image using vb.net in the RadImageEditor?
Harald
Top achievements
Rank 2
 answered on 25 Dec 2014
1 answer
229 views
Hi All, 
About setting themes and styling WPF controls using implicit styles, I set Dark style to Rad controls successfully but about  RadChart , it doesn’t work. indeed  I set dark theme to RadChart successfully using  StyleManager.
I apply implicit styles for the Dark theme in code below, 
Regards

private static void SetTelerikTheme()
        {
 
 
            //Style tbstyle = null;
 
            string themeName = "Expression_Dark";
 
 
 
 
            telerikResources = new List<ResourceDictionary>();
            AddTelerikTheme(themeName, "System.Windows.xaml");
            AddTelerikTheme(themeName, "Telerik.ReportViewer.Silverlight.xaml");
 
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Data.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.DataVisualization.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Diagrams.Extensions.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Diagrams.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Docking.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Expressions.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.FixedDocumentViewers.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.FixedDocumentViewersUI.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.GanttView.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.GridView.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.ImageEditor.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Input.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Navigation.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Pivot.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.PivotFieldList.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.RibbonView.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.RichTextBoxUI.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.ScheduleView.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Spreadsheet.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Documents.Proofing.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Documents.xaml");
            AddTelerikTheme(themeName, "Telerik.Windows.Controls.Chart.xaml");
 
            AddTelerikTheme(themeName, "Expression/Dark/ReportViewer.xaml");
            AddTelerikTheme(themeName, "Expression/Dark/ReportViewerDialogBox.xaml");
            AddTelerikTheme(themeName, "Expression/Dark/ReportViewerErrorStatus.xaml");
 
            foreach (var res in telerikResources)
                App.Current.Resources.MergedDictionaries.Add(res);
        }
 
        private static List<ResourceDictionary> telerikResources = new List<ResourceDictionary>();
 
        private static void AddTelerikTheme(string themeName, string dictionaryName)
        {
            try
            {
                telerikResources.Add(new ResourceDictionary()
                {
                    Source = new Uri("/Telerik.Windows.Themes." + themeName + ";component/Themes/" + dictionaryName,
                        UriKind.RelativeOrAbsolute)
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    dictionaryName + "\r\n" +
                    ex.Message);
            }
        }
Martin Ivanov
Telerik team
 answered on 25 Dec 2014
3 answers
204 views
Hi,
I compined DataForm and PropertyGrid controls properly but I want to do that handle DataFormComboBoxField change event and as configured DataTemplate like that.

<
telerik:RadDataForm Grid.Row="0" x:Name="DataForm1"
                             Header="Actor Basic"
                            AutoGenerateFields="False"
                            ItemsSource="{Binding MyDTO}"
                            ReadOnlyTemplate="{StaticResource MyTemplate}"
                            EditTemplate="{StaticResource MyTemplate}"
                            NewItemTemplate="{StaticResource MyTemplate}"
                            EditEnded="DataForm1_EditEnded" >
<
DataTemplate x:Key="MyTemplate">
                <StackPanel>
                    <telerik:DataFormDataField  Label="İsim" DataMemberBinding="{Binding Name, Mode=TwoWay}" />
                    <telerik:DataFormComboBoxField Label="Some Label" SelectedValuePath="ID" DisplayMemberPath="TypeName"
                                DataMemberBinding="{Binding AnotherId, Mode=TwoWay}"
                                ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type UserControl}}, Path=DataContext.SomeList}" />
                </StackPanel>
            </DataTemplate>
Dimitrina
Telerik team
 answered on 25 Dec 2014
7 answers
348 views
Hi all,

Now I want to create such a below window, see attached file. Basically, it has a different style of Min, Max and Close button. I want to know how do this.

Thanks,
Arthur
Polya
Telerik team
 answered on 24 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?