Telerik Forums
UI for WPF Forum
3 answers
270 views
I have the the following requirements, that I'm unsure as to how to implement with the Rad Diagram control:

Our business objects all have geographical coordinates associated with them.  The objects should be displayed as items on a diagram with the diagram positioning being representative of their geographical coordinates (Note The coordinate system in use is Northing / Easting). These coordinates should be two-way (i.e. the user should be able to drag the object to a new position and this should reflected in our object model).

Thus far I'm having difficulty understanding the following:

1) How to apply a 2 way scaling between the RadDiagram node's Point position and the business objects geographical Coordinates.  The scaling should take into consideration the available space in the RadDiagram and the series of coordinates being plotted.
2) Have the business object's geographical coordinates display in the InformationAdorner i.e. whenever the object is being dragged the adorner should display the coordinates and not the X & Y of the Point.
3) How to flip the Y axis of the diagram (perhaps this is to be done in the scaling?)

I've looked thru' all the examples on the RadDiagram, but none seem appropriate for the above requirements.  Any tips would be appreciated?

Gary.

Pavel R. Pavlov
Telerik team
 answered on 19 Sep 2013
5 answers
306 views
I am able to get the Mockup using CandleStick chart.. Please look into the attached Screenshot.
Can somebody help me in solving the below 2 issues..
    1. I have to display the "HighValue" and "LowValue" at the top and bottom of every item as in the mockup.
    2. Using Annotation, I have drawn a line at the value of "13" and i have named the Label as "BASE VALUE".
       I want that label to be displayed outside the graph as in the mockup.

<
telerik:RadCartesianChart x:Name="xCartesianChart" Height="300"  Width="400" Palette="Windows8" >
            <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis x:Name="verticalAxis"  HorizontalLocation="Left"/>
            </telerik:RadCartesianChart.VerticalAxis>
              
            <telerik:RadCartesianChart.HorizontalAxis >
                    <telerik:CategoricalAxis VerticalLocation="Top" LineThickness="1" LabelInterval="2" ShowLabels="True"/>
            </telerik:RadCartesianChart.HorizontalAxis>
              
            <telerik:CandlestickSeries x:Name="xCandleStick" 
                                       CategoryBinding="XValue" 
                                       LowBinding="YValue2" HighBinding="YValue"
                                       CloseBinding="YValue2" OpenBinding="YValue" 
                                       ShowLabels="True"/>   
              
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Label="BASE VALUE" Value="13" Stroke="Green">
                        <telerik:CartesianGridLineAnnotation.LabelDefinition>
                            <telerik:ChartAnnotationLabelDefinition Location="Left" VerticalAlignment="Top" VerticalOffset="0" HorizontalOffset="80"/>
                        </telerik:CartesianGridLineAnnotation.LabelDefinition>
                    </telerik:CartesianGridLineAnnotation>
            </telerik:RadCartesianChart.Annotations>
              
        </telerik:RadCartesianChart>

//Code-behind
public MainWindow()
        {
            InitializeComponent();
  
            PopulateCartesianChart();
        }
  
void PopulateCartesianChart()
        {
            Random rnd = new Random();
  
            List<ChartDataClass> chartDatas = new List<ChartDataClass>();
  
            for (int i = 0; i < 20; i++)
            {
                ChartDataClass cdc = new ChartDataClass();
                cdc.XValue = i;
                cdc.YValue = rnd.NextDouble() * 100;
                cdc.YValue2 = cdc.YValue - 50;
  
                chartDatas.Add(cdc);
            }
  
            xCartesianChart.Series[0].ItemsSource = chartDatas;
}

Thanks in Advance :)
Evgenia
Telerik team
 answered on 19 Sep 2013
11 answers
783 views
Is there a way to dynamically add panels to the dock control for WPF?  I know in the winforms conrols you can use 

RadDock1.DockControl but I have not seen any samples or documentation for this feature.  I have also looked at the Silverlight documentation and there is nothing there either.

Alex

Vladi
Telerik team
 answered on 19 Sep 2013
7 answers
170 views
Hi!

Have you guys already tried your PDF viewer control on the Win8 community preview ?
We're trying to port an app to Win8 and are unable to get PDF viewer performance under WPF anywhere near the integrated Win8 viewer.

Are we doing something wrong or is there a performance issue with WPF and the touch interface ?

Thanks

Martin

Kammen
Telerik team
 answered on 19 Sep 2013
1 answer
114 views
Hi, I've encountered an issue when a DataGrid is placed inside a RadBusyIndicator (most current build of WPF Controls), a hyperlink in a column in the grid will be disabled.

Here's quick sample of code to demonstrate the problem...
<Window
    xmlns:TestAppWpf="clr-namespace:TestApp_WPF"
    x:Class="TestApp_WPF.MainWindowView"
    x:Name="window"
    Width="800" Height="600"
    TextOptions.TextFormattingMode="Display"
    AllowDrop="True">
 
    <Window.Resources>
        <TestAppWpf:MainWindowViewModel x:Key="Vm" />
    </Window.Resources>
 
    <telerik:RadBusyIndicator DataContext="{Binding Source={StaticResource Vm}}"
                              IsBusy="{Binding IsBusy, Mode=OneWay}"
                              BusyContent="{Binding BusyContent, Mode=OneWay}">
        <StackPanel Margin="6" DataContext="{Binding Source={StaticResource Vm}}">
            <TextBlock Margin="3">
                <Hyperlink>
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <ei:CallMethodAction TargetObject="{Binding}" MethodName="DoWork" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <TextBlock Text="Click Me" />
                </Hyperlink>
            </TextBlock>
 
            <DataGrid Margin="3"
                      ItemsSource="{Binding Items}"
                      SelectedItem="{Binding SelectedItem}"
                      AutoGenerateColumns="False"
                      SelectionUnit="FullRow"
                      SelectionMode="Single"
                      CanUserDeleteRows="False"
                      CanUserAddRows="False"
                      IsReadOnly="True"
                      AllowDrop="True">
 
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding FirstName}" />
                    <DataGridTextColumn Binding="{Binding LastName}" />
                    <DataGridTextColumn Binding="{Binding DOB}" />
 
                    <DataGridTemplateColumn x:Name="uxColumn_Edit"
                                            CanUserSort="False">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Margin="3">
                                    <Hyperlink>
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <ei:CallMethodAction
                                                    TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=DataContext}"
                                                    MethodName="DoWork" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                        <TextBlock Text="Edit" />
                                    </Hyperlink>
                                </TextBlock>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </telerik:RadBusyIndicator>
</Window>

and the view model...
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
 
namespace TestApp_WPF
{
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        #region Fields
 
        private bool _isBusy;
        private string _busyContent;
        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnProperyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
 
        public ObservableCollection<Person> _items;
        public Person _selectedItem;
 
        #endregion
 
        #region Properties
 
        /// <summary>
        ///     Gets or sets a value indicating whether [is busy].
        /// </summary>
        /// <value>
        ///     <c>true</c> if [is busy]; otherwise, <c>false</c>.
        /// </value>
        public bool IsBusy
        {
            get { return _isBusy; }
            set
            {
                if (_isBusy == value)
                    return;
 
                _isBusy = value;
                OnProperyChanged("IsBusy");
            }
        }
 
        /// <summary>
        ///     Gets or sets the content of the busy.
        /// </summary>
        /// <value>
        ///     The content of the busy.
        /// </value>
        public string BusyContent
        {
            get { return _busyContent; }
            set
            {
                if (_busyContent == value)
                    return;
 
                _busyContent = value;
                OnProperyChanged("BusyContent");
            }
        }
 
        /// <summary>
        /// Gets the items.
        /// </summary>
        /// <value>
        /// The items.
        /// </value>
        public ObservableCollection<Person> Items
        {
            get
            {
                if (_items == null)
                {
                    _items = new ObservableCollection<Person>
                    {
                        new Person
                        {
                            FirstName = "John",
                            LastName = "Doe",
                            DOB = new DateTime(1972, 5, 9),
 
                        },
                        new Person
                        {
                            FirstName = "Jim",
                            LastName = "Smith",
                            DOB = new DateTime(1954, 12, 15),
 
                        }
                    };
                }
 
                return _items;
            }
        }
 
        /// <summary>
        /// Gets or sets the selected item.
        /// </summary>
        /// <value>
        /// The selected item.
        /// </value>
        public Person SelectedItem
        {
            get { return _selectedItem; }
            set
            {
                if (_selectedItem == value)
                    return;
 
                _selectedItem = value;
                OnProperyChanged("SelectedItem");
            }
        }
 
        #endregion
 
        #region Methods
 
        public void DoWork()
        {
            Task.Factory.StartNew(
                () =>
                {
                    IsBusy = true;
                    BusyContent = "Working...";
                    Thread.Sleep(5000);
                    IsBusy = false;
                });
        }
 
        #endregion
    }
 
    public class Person
    {
        public string FirstName { get; set; }
 
        public string LastName { get; set; }
 
        public DateTime DOB { get; set; }
    }
}

As you'll see, the hyperlinks in the datagrid's "edit" column are disabled.  However, if you comment out the RadBusyIndicator (and it's closing tag), the "edit" column will then be enabled.  Also, if it helps, if you change the datagrid to "IsReadOnly=False", then an edit hyperlink will become enabled if you double click on it.

As you can also see, the hyperlink at the top of the window that is not part of the datagrid is unaffected by this issue.

Thanks,
Andy
Kalin
Telerik team
 answered on 19 Sep 2013
8 answers
213 views
Hello,

I have a problem with setting AlternateRowBackground or AlternateRowStyle for RadTreeListView. It occures only when vertical scroll bar is visible.

When I put hierarchical data into RadTreeListView and begin to expand and collapse parent rows alternation coloring becomes broken. So I get a pair of rows with the same color instead of iterating.

There's a screenshot of the result in the attach.

The code is very simple:      
<telerik:RadTreeListView ItemsSource="{Binding Path=TestData}"
                         AlternationCount="2"
                         AlternateRowBackground="DarkGray">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=Children}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>
Pavel
Top achievements
Rank 1
 answered on 19 Sep 2013
1 answer
96 views
Hi, I have problem, When I expand node in my treeview my text (TreeViewItems Header) gets blured, I am using in animation (on collapsed out animation) 

<Setter Property="telerik:AnimationManager.AnimationSelector">
    <Setter.Value>
        <telerik:AnimationSelector>
            <Animation:TreeViewExpandCollapseAnimation AnimationTargetName="ItemsHost" AnimationName="Expand" Direction="In" Duration="00:00:01"  SpeedRatio="3" TargetName="{x:Null}"/>
            <Animation:TreeViewExpandCollapseAnimation AnimationTargetName="ItemsHost" AnimationName="Collapse" Direction="Out" Duration="00:00:01" SpeedRatio="3" TargetName="{x:Null}"/>
        </telerik:AnimationSelector>
    </Setter.Value>
</Setter>

Pavel R. Pavlov
Telerik team
 answered on 19 Sep 2013
1 answer
49 views
Hi, i want to edit a checkbox in hierarchy but it doesnt happend, Is that posible? Thanks
Dimitrina
Telerik team
 answered on 19 Sep 2013
7 answers
329 views
Hi,

Is it possible to add a map pin point on a mouse click event,using the mvvm pattern?

Thanks
Andrey
Telerik team
 answered on 19 Sep 2013
0 answers
55 views
It is related to: http://www.telerik.com/community/forums/wpf/general-discussions/calling-a-udf-for-populating-a-radgridview-fails.aspx

Without setting a precedent.. I really very appreciated your help.
Enric
Top achievements
Rank 1
 asked on 18 Sep 2013
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?