Telerik Forums
UI for WPF Forum
6 answers
125 views
My Series data is decided in run-time.

Below my xaml code.

            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider Source="{Binding Series}">
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
                        <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" ValuePath="Value" CategoryPath="Time" >
                            <telerik:CategoricalSeriesDescriptor.Style>
                                <Style TargetType="telerik:LineSeries">
                                    <Setter Property="StrokeThickness" Value="1"/>
                                    <Setter Property="Visibility" Value="{Binding Name , Converter={StaticResource pointFocusConverter}}"/>
                                    <Setter Property="LegendSettings">
                                        <Setter.Value>
                                            <telerik:SeriesLegendSettings Title="{Binding Name}"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="VerticalAxis">
                                        <Setter.Value>
                                            <telerik:LinearAxis/>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </telerik:CategoricalSeriesDescriptor.Style>
                        </telerik:CategoricalSeriesDescriptor>
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>


In this code, 'StrokeThickness', 'Visibility' and 'LegendSettings' is confirmed binding
According to other code,  'VerticalAxis' property is dynamically making Yaxis.
But does not working.
Please help me.





Lee
Top achievements
Rank 1
 answered on 25 Apr 2014
4 answers
340 views
Hi,
in my application I'm recording values at run-time. So I add series dynamic to my chartview. Next step would be to add vertical axis dynamically to my chartview.
So I added a collection where I can add the axis at run-time. Then when I want to change from one axis to another i got a InvalidOperationException: Specified element is already the logical child of another element. Disconnect it first.

Here is my SeriesProvider:
<telerik:RadCartesianChart.SeriesProvider>
    <telerik:ChartSeriesProvider Source="{Binding RecItemCollection}">
        <telerik:ChartSeriesProvider.SeriesDescriptors>
            <telerik:CategoricalSeriesDescriptor ItemsSourcePath="DataItems" ValuePath="ItemValue" CategoryPath="Time">
                <telerik:CategoricalSeriesDescriptor.Style>
                    <Style TargetType="telerik:LineSeries">
                        <Setter Property="RenderMode" Value="Full"/>
                        <Setter Property="StrokeThickness" Value="2"/>
                        <Setter Property="Stroke" Value="{Binding Stroke}"/>
                        <Setter Property="Visibility" Value="{Binding Visibility}"/>
                        <Setter Property="VerticalAxis" Value="{Binding VerticalAxis}"/>                                   
                    </Style>
                </telerik:CategoricalSeriesDescriptor.Style>
            </telerik:CategoricalSeriesDescriptor>
        </telerik:ChartSeriesProvider.SeriesDescriptors>
    </telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>

Is there another way to do this?

Reagards Markus
Klemens
Top achievements
Rank 1
 answered on 24 Apr 2014
1 answer
212 views
I have the following custom control:

<telerik:RadTileViewItem x:Class="CrmActivityTimer.Customcontrols.TimerTile"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:tileView="clr-namespace:Telerik.Windows.Controls.TileView;assembly=Telerik.Windows.Controls.Navigation"
             xmlns:customcontrols="clr-namespace:CrmActivityTimer.Customcontrols"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             mc:Ignorable="d" Height="525" Width="375" TileStateChanged="TimerTile_OnTileStateChanged" HeaderStyle="{StaticResource TimerTileHeaderStyle}">
    <telerik:RadTileViewItem.Resources>
    </telerik:RadTileViewItem.Resources>
    <Grid>
 
        <TextBox Text="{Binding Timer.TimeElapsed}" Width="100px" Height="20px" Margin="102,17,155,437" IsReadOnly="True"/>
        <Button Height="20px" Width="20px" Margin="216,17,121,437" Click="PlayButton_OnClick">
            <Image Source="icons/Play.png" />
        </Button>
        <Button Height="20px" Width="20px" Margin="242,17,95,437" Click="PauseButton_OnClick">
            <Image Source="icons/Pause.png"  />
        </Button>
        <telerik:RadComboBox Name="CboKlant" HorizontalAlignment="Left" Margin="101,79,0,0" VerticalAlignment="Top" Width="230"
                             ItemsSource="{Binding Fields.Accounts}" DisplayMemberPath="Name" SelectedValuePath="AccountId" KeyboardNavigation.TabIndex="1"/>
        <telerik:RadComboBox Name="CboBetreft" HorizontalAlignment="Left" Margin="101,160,0,0" VerticalAlignment="Top" Width="230" KeyboardNavigation.TabIndex="4"
                             DisplayMemberPath="{Binding Fields.BetreftNameField}" SelectedValuePath="{Binding Fields.BetreftIdField}"/>
 
        <TextBox Name="TxtOnderwerp" HorizontalAlignment="Left" Height="23" Margin="102,50,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="230" KeyboardNavigation.TabIndex="0"/>
        <Label Content="Onderwerp" HorizontalAlignment="Left" Margin="10,50,0,0" VerticalAlignment="Top" Height="23" Width="87" Padding="0"/>
        <Label Content="Klant" HorizontalAlignment="Left" Margin="9,78,0,0" VerticalAlignment="Top" Height="23" Width="87" Padding="0"/>
        <Label Content="Betreft" HorizontalAlignment="Left" Margin="9,159,0,0" VerticalAlignment="Top" Height="23" Width="87" Padding="0"/>
        <telerik:RadComboBox x:Name="CboUser" HorizontalAlignment="Left" Margin="101,188,0,0" VerticalAlignment="Top" Width="230" KeyboardNavigation.TabIndex="5"
                             ItemsSource="{Binding Fields.Users}" DisplayMemberPath="FullName" SelectedValuePath="SystemUserId" SelectedValue="{Binding Fields.Currentuser}" />
        <Label Content="Gebruiker" HorizontalAlignment="Left" Margin="9,187,0,0" VerticalAlignment="Top" Height="23" Width="87" Padding="0"/>
        <telerik:RadComboBox x:Name="CboService" HorizontalAlignment="Left" Margin="101,216,0,0" VerticalAlignment="Top" Width="230" KeyboardNavigation.TabIndex="6"
                             ItemsSource="{Binding Fields.Services}" DisplayMemberPath="Name" SelectedValuePath="ServiceId"/>
        <Label Content="Service" HorizontalAlignment="Left" Margin="9,215,0,0" VerticalAlignment="Top" Height="23" Width="87" Padding="0"/>
        <Button HorizontalAlignment="Left" Height="35" Margin="296,10,0,0" VerticalAlignment="Top" Width="35" Click="BtnCreateActivity_OnClick">
            <Image Source="icons/Save.png" Width="35"/>
        </Button>
        <telerik:RadComboBox HorizontalAlignment="Left" Margin="101,106,0,0" VerticalAlignment="Top" Width="230" SelectionChanged="CboKoppelingsType_OnSelectionChanged" KeyboardNavigation.TabIndex="2">
            <telerik:RadComboBoxItem Content="Verkoopkans"/>
            <telerik:RadComboBoxItem Content="Job"/>
            <telerik:RadComboBoxItem Content="Ticket"/>
        </telerik:RadComboBox>
        <Label Content="Betreft is een..." HorizontalAlignment="Left" Margin="9,106,0,0" VerticalAlignment="Top" Width="87" Height="22" Padding="0"/>
        <Label Content="Project" HorizontalAlignment="Left" Margin="9,133,0,0" VerticalAlignment="Top" Width="88" Padding="0"/>
        <telerik:RadComboBox Name="CboProject"  HorizontalAlignment="Left" Margin="102,133,0,0" VerticalAlignment="Top" Width="229" KeyboardNavigation.TabIndex="3"
                              ItemsSource="{Binding Fields.Projects}" DisplayMemberPath="New_titel" SelectedValuePath="New_ProjectId" SelectionChanged="CboProject_SelectionChanged" />
        <TextBox Name="TxtVoorKlant" HorizontalAlignment="Left" Height="166" Margin="9,282,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="147"/>
        <TextBox Name="TxtVoorIntern" HorizontalAlignment="Left" Height="166" Margin="176,282,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="155"/>
        <Label Content="Voor de klant" HorizontalAlignment="Left" Margin="9,251,0,0" VerticalAlignment="Top" Width="87" Padding="0"/>
        <Label Content="Intern" HorizontalAlignment="Left" Margin="170,251,0,0" VerticalAlignment="Top" Width="87" Padding="0"/>
    </Grid>
</telerik:RadTileViewItem>

I want to add a close button to the header, to the right of where the minimize and maximize buttons appear normally. I've googled for this problem and every solution I come across involves assigning a custom template to an unextended RadTileViewItem. I don't know how to convert these solutions for application to a custom control. I've tried multiple solutions from this website so far, but I can't get it to work.
Pavel R. Pavlov
Telerik team
 answered on 24 Apr 2014
3 answers
163 views
Good afternoon,

I've read a 2009 thread saying it was not possible to export a chart in vector graphic, but only as images. As it is very important for our application, I wanted to ask wether it is still the case today ? And if it is not the case, is there a way to access graphical elements and reconstruct the graphic ?

Thank you,

Flavien Gyger
Petar Marchev
Telerik team
 answered on 24 Apr 2014
1 answer
116 views
Hello Friends,

I have just started working with Telerik UI for WPF and currently working on the RadDiagram.

After going through the Documentation, i am looking forward for some code samples for  RadDiagram.

Also just want your guidance how and where should i start leaning Telerik UI for WPF .
Pavel R. Pavlov
Telerik team
 answered on 24 Apr 2014
7 answers
290 views
I am creating some rather large diagrams that take some time to load, so I am using a busy indicator to display while the diagram loads. I run this busy indicator in a background thread to keep the UI responsive. Once the loading is complete in the RunWorkerCompleted method I set the GraphSource property in my ViewModel which is bound to my diagram. I am subscribing to the GraphSourceChanged event of the diagram, at which point I set the layout to be â€‹'TreeLayoutType.TreeDown'. 

This was working perfectly until I introduced the busy indicator on a seperate thread. The GraphSourceChanged still gets called at the appropriate time however the diagram does not layout at all with all of the diagram items stacked on top of each other. Im assuming this is a threading issue, but thought it would work correctly as in setting the databound GraphSource property on the RunWorkerCompleted which should be using the UI thread.

Any help appreciated.
Pavel R. Pavlov
Telerik team
 answered on 24 Apr 2014
1 answer
217 views
Hi,

I have a problem serializing and deserializing a business object, expanding on your examples:
http://www.telerik.com/help/wpf/raddiagram-howto-drag-custom-toolboxitem.html (1)
http://www.telerik.com/help/wpf/raddiagram-extensions-toolbox.html#PopulateWithCustomData (2)

Your examples work just fine (when I changed the geometry handling, because of localization issues, I think).
But when I try to add more properties, and serialize them, I get an error deserializing the objects.

After searching, I have now found this thread:
http://www.telerik.com/forums/adding-my-own-properties-into-settingspane-of-raddiagram-on-selection-of-shape (3)
In this thread, Zarko writes (in September 13th 2012):
...
"As for your second question - unfortunately at the moment the RadDiagram supports only string serialization."

I now have to ask: Is this still the case? I would expect serialization to have been handled way before now.
And if this is the case, how can I get around this? Can you come with a solution so that I can handle what I am trying in my example (see below)?

Thank you very much!



I have the full sample project as png files attached, but here is the issue from my point of view:

namespace DeserializationProblem
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            SerializationService.Default.ItemSerializing += Default_ItemSerializing;
        }

        void Default_ItemSerializing(object sender, SerializationEventArgs<IDiagramItem> e)
        {
            if (e.Entity is RadDiagramShape)
            {
                Geometry g = (e.Entity as RadDiagramShape).Geometry;
                string g_string = GeometryParser.GetString(g);               
                e.SerializationInfo["MyGeometry"] = g_string;
                if ((e.Entity as RadDiagramShape).DataContext is MyShape)
                {
                    e.SerializationInfo["DataContent"] =
                        ((e.Entity as RadDiagramShape).DataContext as MyShape).Header;

                    e.SerializationInfo["DataContent2"] =
                        ((e.Entity as RadDiagramShape).DataContext as MyShape);
                    var test = (MyShape)e.SerializationInfo["DataContent2"];    // <- Works fine
                }
            }
        }

        private void radDiagram1_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            if (e.Shape as RadDiagramShape != null)
            {
                //SerializationInfo e_info = (SerializationInfo)e.SerializationInfo["MyGeometry"];
                string e_info_string = e.SerializationInfo["MyGeometry"].ToString();
                Geometry g = GeometryParser.GetGeometry(e_info_string);               
                (e.Shape as RadDiagramShape).Geometry = g;

                (e.Shape as RadDiagramShape).Content = e.SerializationInfo["DataContent"].ToString(); // <- Works
                var test = (MyShape)e.SerializationInfo["DataContent2"];    // <- Breaks
                // Error: Unable to cast object of type 'System.String' to type 'DeserializationProblem.MyShape'.
                // e.SerializationInfo["DataContent2"] is now a string "DeserializationProblem.MyShape"
            }
        }
    }
}  
 
Martin Ivanov
Telerik team
 answered on 23 Apr 2014
6 answers
176 views
Hello,

I am having some problems on our solution with the IColumnFilterDescriptor.

Here is our C# implementation :

private void searchTextbox_KeyDown(object sender, KeyEventArgs e)
       {
           if (e.Key == Key.Enter) // Enter key pressed
           {
               this.treeListView.FilterDescriptors.Clear();
               var searchTextBox = (TextBox)sender;
 
               if (!string.IsNullOrWhiteSpace(searchTextBox.Text))
               {
                   //this.treeListView.FilterDescriptors.SuspendNotifications();
 
                   if (this.FilterColumns.Count() < 2)
                   {
                       var filterColumn = this.treeListView.Columns[0];
                       filterColumn.ClearFilters();
                       IColumnFilterDescriptor columnDescriptor = filterColumn.ColumnFilterDescriptor;
                       columnDescriptor.FieldFilter.Clear();
 
                       if (!string.IsNullOrWhiteSpace(searchTextBox.Text))
                       {
                           columnDescriptor.SuspendNotifications();
                           columnDescriptor.FieldFilter.Filter1.Operator = FilterOperator.Contains;
                           columnDescriptor.FieldFilter.Filter1.Value = searchTextBox.Text.Trim();
                           columnDescriptor.FieldFilter.Filter1.IsCaseSensitive = false;
 
                           if (columnDescriptor.FieldFilter.Filter2 != null)
                           {
                               columnDescriptor.FieldFilter.Filter2.Operator = FilterOperator.IsNotNull;
                               columnDescriptor.FieldFilter.Filter2.Value = null;
                           }
                           try
                           {
                               columnDescriptor.ResumeNotifications();
                           }
                           catch (ArgumentException) { }
                       }
                   }
                   else
                   {
                       CompositeFilterDescriptor compositeDescriptor = new CompositeFilterDescriptor();
                       compositeDescriptor.LogicalOperator = FilterCompositionLogicalOperator.Or;
                       foreach (var column in this.FilterColumns)
                       {
                           compositeDescriptor.FilterDescriptors.Add(new FilterDescriptor(column,FilterOperator.Contains, searchTextbox.Text, false, typeof(string)));
                       }
 
                       //this.treeListView.FilterDescriptors.SuspendNotifications();
                       this.treeListView.FilterDescriptors.Add(compositeDescriptor);
                       //this.treeListView.FilterDescriptors.ResumeNotifications();
                   }
                   //this.treeListView.FilterDescriptors.ResumeNotifications();
               }
           }
       }

The problem occurs when we in the gridview, we have 2 different item types at the same level. Here is the error we are getting on the columnDescriptor.ResumeNotifications() event :
ArgumentException :
The value "(Empty) AND ((Title Contains ma) AND (Title IsNotNull null))" is not of type "Telerik.Windows.Data.IFilterDescriptor" and cannot be used in this generic collection.
Parameter name: value

We are following the examples shown on your site.
We've been trying to figure out this problem for ours without any success. Any idea where this problem comes from?



ASSYST2 - CGI
Top achievements
Rank 1
 answered on 23 Apr 2014
3 answers
170 views
Hi,

I created a usercontrol base on a ScheduleView. My user control contain a "OnCanDrop" event and a "SetDataSource" method. When I create my UserControl, I fill the view with ReadOnly slots. The user can use the "SetDataSource" method to fill the view with "Appointments" and "SpecialSlots". Appointments is for appointments and SpecialSlots is for open slots where user can drag apointments into it of where user can create new appointments.

My objects (appointments and special slots) contain specifics members for logical purpose.

What I'm trying to do in my a drag and drop behavior, it's to raise my event with the source appointment the user is dragging and the specialslot where the user is trying to drop or drag over so the user can decide if the appointment is trying to drag can be drop or not on the specialslot I raised through my event base on a logic he decided.

If I have an appointment from 8h00 to 8h15 and I want to drag it in the special slot 8h15 to 8h30. I want to raise my event only when I'm over the special slot not after each mouse move of my appointment.

Thank's
Alain
Kalin
Telerik team
 answered on 23 Apr 2014
3 answers
93 views
Hi,

May i know how can i accomplish this pls?

http://clip2net.com/s/7e5IEa

Our requirement is to use car icons as MapPinPoint. I already accomplish that using this code

<br> MapPinPoint pinPoint = new MapPinPoint()<br>                {<br>                    Background = new SolidColorBrush(Colors.Transparent),<br>                    Foreground = new SolidColorBrush(Colors.Transparent),<br>                    FontSize = 14,<br>                    Text = "test" + i ,<br>                    ImageSource = new BitmapImage(new Uri(@"https://cdn4.iconfinder.com/data/icons/aiga-symbol-signs/388/aiga_taxi-32.png", UriKind.Absolute))<br>                };<br><br> this.informationLayer.Items.Add(pinPoint);

Our next requirment is to put a tooltip like popup whenever the user clicks on the icon car. It also has some labels or buttons on the bottom. it must trigger an event like click on the backend whenever clicked. example "Send a message" it will trigger click event of that "send message button" to show a form.


May i ask how is this possible? im having a hardtime doing this. can i have a sample project from you?

THanks





















































Martin Ivanov
Telerik team
 answered on 23 Apr 2014
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?