Telerik Forums
UI for WPF Forum
1 answer
141 views
Hello.


I have a sql server Table which contains some geometry data ( about 150 points), a column  with the color to applied on these points, and a label.

I need to display these points on my map with the right color and the corresponding label.

I'm new in WPF and telerik objects. If you can explain to me what object I should use (MapPinPoint, MapEllipse. i am lost with your different points objects. And i don't see how I can change the color of a particular point in code behind
Pavel R. Pavlov
Telerik team
 answered on 09 May 2014
3 answers
250 views
I've come across a strange problem when trying to use RelativeSource binding in the DataTemplate used for styling the LabelTemplate of an axis. When RelativeSource binding is used, the labels are drawn over the left side of the chart instead of to the left.

Below is  the code for a simple example exhibiting the problem. (It's obviously a convoluted example since the numbers are all being set to the same value. In my real application I experienced the problem using MultiBinding to pass in some settings as well as the value, but this simpler example shows the same symptoms with single Binding).

If I bind to the Property using ElementName, it displays correctly. However, if I reference the exact same property using RelativeSource, the value is picked up successfully, but the labels are displayed incorrectly. See attached screen shot.

I have a work-around by using the ElementName, but ideally I'd like to use the RelativeSource instead to reference the owning ChartView such that the formatter can be put in a dictionary and used across several charts without having to assign them all the same name.

Thanks,
Louis

The sample app:

<Window x:Class="LabelTemplate_MultiBinding.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:local="clr-namespace:LabelTemplate_MultiBinding"
                Title="MainWindow" Height="768" Width="1024">
    <Grid>
        <telerik:RadCartesianChart x:Name="PropertyChart">
            <telerik:RadCartesianChart.Resources>
                <local:ChartNumberFormatter x:Key="NumberFormatter"/>
                <DataTemplate x:Key="FormattedNumericAxisTemplate">
 
                    <!-- This uses the converter sending the desired value, and it works fine -->
                    <!--<TextBlock Text="{Binding ., Converter={StaticResource NumberFormatter}}" />-->
                     
                    <!-- This uses the converter sending some value via binding using ElementName,
                         and it works fine -->
                    <!--<TextBlock Text="{Binding Path=DataContext.JustANumber,
                                              Converter={StaticResource NumberFormatter},
                                              ElementName=PropertyChart}" />-->
                     
                    <!-- This uses the converter sending the same value as above via binding,
                         but using RelativeSource instead, and it displays incorrectly! -->
                    <TextBlock Text="{Binding Path=DataContext.JustANumber,
                                              Converter={StaticResource NumberFormatter},
                                              RelativeSource={RelativeSource AncestorType={x:Type telerik:RadCartesianChart}}}" />
                </DataTemplate>
            </telerik:RadCartesianChart.Resources>
 
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
 
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis LabelTemplate="{StaticResource FormattedNumericAxisTemplate}" />
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.Series>
                <telerik:LineSeries
                       CategoryBinding="Date"
                       ValueBinding="Value"
                       ItemsSource="{Binding Path=Series1}">
                </telerik:LineSeries>
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>
    </Grid>
</Window>

The code-behind:
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Data;
 
namespace LabelTemplate_MultiBinding
{
    public class MyPoint
    {
        public DateTime Date { get; set; }
        public Double Value { get; set; }
    }
    public partial class MainWindow : Window
    {
        public List<MyPoint> Series1 { get; private set; }
        public string DisplaySuffix { get; private set; }
        public double JustANumber { get; private set; }
        public MainWindow()
        {
            Series1 = new List<MyPoint>();
            DisplaySuffix = "M";
            JustANumber = 50000;
            for (int i = 0; i < 5; i++)
            {
                DateTime date = DateTime.Today.AddDays(i);
                Series1.Add(new MyPoint() { Date = date, Value = i * 1000 });
            }
            InitializeComponent();
            DataContext = this;
        }
    }
    public class ChartNumberFormatter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double number = System.Convert.ToDouble(value);
            return number.ToString("N0");
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

Petar Marchev
Telerik team
 answered on 09 May 2014
4 answers
202 views
Hi,

In My ViewModel I have: public ObservableCollection<OrderModel> Orders { get; set; }

In OrderModel have: public IEnumerable<utOrderItem> OrderItems { get; set; }

I try to bind this OrderItems to a GridViewComboBoxColumn in RadGridView just to list them:

<telerik:RadGridView Grid.Row="1" Name="grdOrders" ItemsSource="{Binding Orders}" .............

                <telerik:GridViewComboBoxColumn ItemsSource="{Binding Orders[].OrderItems}" Header="Order Items">
                    <telerik:GridViewComboBoxColumn.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="0" Text="{Binding Quantity}" />
                                <TextBlock Grid.Column="1" Text="{Binding ItemType}" />
                                <TextBlock Grid.Column="2" Text="{Binding UnitPrice}" />
                            </Grid>
                        </DataTemplate>
                    </telerik:GridViewComboBoxColumn.ItemTemplate>
                </telerik:GridViewComboBoxColumn>

                <telerik:GridViewDataColumn DataMemberBinding="{Binding OrderItems.Count}" Header="Order Item Count"/>

Column "Order Items" not show anything
Column "Order Item Count" works

Please advise how I can bind collection that exist in every record?

Best regards,
Saykor





Boris
Telerik team
 answered on 08 May 2014
1 answer
87 views
I want to make some letters be bold in the RadGridViewCell. How can I do this ? 
Boris
Telerik team
 answered on 08 May 2014
1 answer
121 views
Hi guy,
I'm using RadGrid to binding data,
How to ScrollViewer to the left of the RadGrid,default ScrollViewer on the right side.
Sory my english.
Boris
Telerik team
 answered on 08 May 2014
1 answer
41 views
Hello. I am considering about 'AutoGenerateColumns'.

I change telerik .dll by purchasing 'UI for WPF'

But My GridView is not working about below code.

<Style TargetType="telerik:GridViewRow">
          <Setter Property="IsSelected" Value="{Binding Title, Converter={StaticResource selectedItemConverter}, ConverterParameter=Chart}"/>
</Style>

Because 'AutoGenerateColumns' is 'False'.

If 'AutoGenerateColumns' setting 'True' is well work.

I want to value that 'AutoGenerateColumns' is 'False'.

What should I do??
Dimitrina
Telerik team
 answered on 08 May 2014
1 answer
129 views
Hi Support,

 i have defined global style as per your guide http://www.telerik.com/help/wpf/gridview-styling-cell.html , and applied it to columns individually then the style is not applied to cells, when i define it locally then it is applied

Thanks
Pallavi
Boris
Telerik team
 answered on 08 May 2014
1 answer
111 views
Hi,

I'm using the Office2013 theme and I would like to knowif it's possible to change the background color/brush of the cells in the background without using the SpecialSlots?

Thank's
Alain
Kalin
Telerik team
 answered on 08 May 2014
1 answer
84 views
Hi,

I use the Office2013 theme and I would like to know if it's possible to hide the selection of a cell but keep the selection of the SpecialsSlots and the Appointments?!?

Actually if I have a MinotTickLength of 30 mins, and I have 1 special slot and 1 appointment in the cell of my control, I would like to highlight only the selected special slot or the selected appointment and ignore the selection of the cell.

Thank's
Alain
Kalin
Telerik team
 answered on 08 May 2014
3 answers
98 views
Hello,

I've been experimenting with creating a numeric indication with the Telerik suite and I have encountered a few problems. I am attempting to use the HexagonalNumberPosition and it seems to not handle a few situations particularly well. For example, if the control is made too large, there are a lot of rough edges around some of the edges of the segments. Also, the decimal scales very badly and is comparatively huge for a decimal place.

Is there any way I can better control the rendering of these elements?

Thanks
Pavel R. Pavlov
Telerik team
 answered on 08 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?