Telerik Forums
UI for WPF Forum
1 answer
95 views
I have these two classes

public class CustomerModel : _BaseModel
{
    public int CustomerId { get; set; }
    public string CustomerCode { get; set; }
    public string CustomerName { get; set; }
    public List<ProjectModel> Projects { get; set; }
}

and

public class ProjectModel : _BaseModel
{
    public int ProjectId { get; set; }
    public int UserId { get; set; }
    public int CustomerId { get; set; }
    public WarehouseModel PrimaryWarehouse { get; set; }
    public WarehouseModel SecondaryWarehouse { get; set; }
    public ProjectType ProjectType { get; set; }
    public string ProjectName { get; set; }
    public string ProjectNum { get; set; }
    public DateTime Date { get; set; }
    public string Comments { get; set; }
}

and my XAML:

<Window.Resources>
  
    <DataTemplate x:Key="Project">
        <TextBlock Text="{Binding ProjectName}" />
    </DataTemplate>
  
    <HierarchicalDataTemplate x:Key="Customer" 
                                ItemTemplate="{StaticResource Project}"
                                ItemsSource="{Binding Customers}">
        <TextBlock Text="{Binding CustomerName}" />
    </HierarchicalDataTemplate>
  
</Window.Resources>
     

and

<telerik:RadTreeView ItemsSource="{Binding Customers}"
              ItemTemplate="{StaticResource Customer}"/>

When I run it, I see the Customer nodes, but not the Project nodes
Petar Mladenov
Telerik team
 answered on 02 May 2011
4 answers
93 views
Hi,

I would like to localize texts like "Drag a column header and drop it here to group by that column" and others. The standard approach as explained at http://www.telerik.com/help/silverlight/common-localization.html doesn't work for me, because I need instant translation if the culture changes. So I would like to bind these texts to viewmodel properties. How can I do that?

Thanks,
L
Ludwig
Top achievements
Rank 1
 answered on 02 May 2011
3 answers
82 views
hii
i want to know is it posible to maximize & minimize of my tile view to click on anywhere in tileview. now its is minimize & maximize through button i.e displayed on corner side of tileviewitem but i want to click any where of this particular tileviewitem & perform minimize & maximize it.
Petar Mladenov
Telerik team
 answered on 02 May 2011
2 answers
83 views
In the RadControls for WPF demo app, in the lower left corner is a very handy "Browse Controls" multi-level button. I'm really curious how to replicate that functionality. :)
ResourceJeremy
Top achievements
Rank 1
 answered on 02 May 2011
1 answer
143 views
Hi,
I'm having problems using a convertor on a WPF GridView
I'm trying to set the background colour.
The background sets correctly when I highlight any particular row in the GridView, however all other columns get set to this colour in the entire grid.

e.g. If I Click a row where the person has account balance 0 to 5 (e.g. red) every row goes red in this column
If I click a row where the person has account balance that converts to green every row goes green in this column and so on.

Below is the convertor, class person and XAML from my project.



CONVERTER:
Public Class AccountBalanceToColourConvertor
    Implements IValueConverter


    Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Dim x As Double
        x = value
        Select Case x
            Case 0 To 5
                Return "Red"
            Case 5.01 To 50
                Return "Orange"
            Case Is > 50
                Return "Green"
        End Select
    End Function


    Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        ' Only is a one way conversion
    End Function
End Class

CLASS PERSON
Public Class Person
    Public Property Forename As String
    Public Property AccountBalance As Double
    Public Enum Gender
        Male = 1
        Female = 2
        Unknown = 3
    End Enum
End Class



XAML

    <Window.Resources>
        <my1:AccountBalanceToColourConvertor x:Key="AccountBalanceToColourConvertor" />
        <CollectionViewSource x:Key="PersonViewSource" d:DesignSource="{d:DesignInstance my1:Person, CreateList=True}" />
    </Window.Resources>
    <Grid DataContext="{StaticResource PersonViewSource}">
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="ComboBox1" 
               
                  VerticalAlignment="Top" Width="120" />
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="147,12,0,0" Name="Button1" VerticalAlignment="Top" Width="75" />
        <telerik:RadGridView Height="136" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="12,62,0,0" Name="PersonRadGridView" VerticalAlignment="Top" Width="352" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn  DataMemberBinding="{Binding AccountBalance}"  Header="Account Balance" Width="Auto" DataFormatString="N2"
                                             Background="{Binding Path=AccountBalance, Converter={StaticResource AccountBalanceToColourConvertor}}">


            </telerik:GridViewDataColumn>
          </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>



Ivan Ivanov
Telerik team
 answered on 02 May 2011
1 answer
126 views
I'm trying to hide the item labels on my chart.  There are 52 items on one chart, so the item labels hide the actual line on the chart.  I can't figure out how to turn them off.  The data is generated from the code-behind.  Here is a snippet that shows how I am creating the chart data:

SeriesMapping mySeries = new SeriesMapping();
mySeries.LegendLabel = "Current Year Cash Balance";
mySeries.SeriesDefinition = new SplineSeriesDefinition();
mySeries.SeriesDefinition.Appearance.StrokeThickness = 3;
mySeries.ItemMappings.Add(new ItemMapping("CashBalance", DataPointMember.YValue));
mySeries.ItemMappings.Add(new ItemMapping("Week", DataPointMember.XCategory));
secondaryChart.SeriesMappings.Add(mySeries);
secondaryChart.DefaultSeriesDefinition.ShowItemLabels = false;
 
secondaryChart.ItemsSource = cashBalanceData.Tables["currentCashBalance"];

Is there a simple way to do this?  Demo code would be most appreciated.  I would prefer the option to do it either in the XAML or the code-behind, since I might want to set the default in the XAML but then change it in the code-behind.
Giuseppe
Telerik team
 answered on 02 May 2011
5 answers
406 views
I have a datagrid with a select column.
I want to view RowDetails for selected row on the click of a button.
Can you help in implementing this using MVVM pattern?
Maya
Telerik team
 answered on 02 May 2011
1 answer
70 views
I need to generate graphs on the fly and only when I receive the response will I know what type of graph to generate.

I have been trying for about a hour and cannot figure it out.  What am I doing wrong?  The legend shows the title, but it does not show the legend label that has been associated with each datapoint.  Why?

What am I missing?
           
var chartArea = new ChartArea();
 chartArea.LegendName = "test";
             
 var pieSeries = new DataSeries
 {
     Definition = new PieSeriesDefinition
     {
         InteractivitySettings =
             {HoverScope = InteractivityScope.None,
              SelectionScope = InteractivityScope.Item,
               SelectionMode = ChartSelectionMode.Single
              }
     }
 };
             
 
pieSeries.Definition.ItemLabelFormat = "p";
pieSeries.Add( new DataPoint() { YValue = 0.215208267, LegendLabel = "Toyota" } );
pieSeries.Add( new DataPoint() { YValue = 0.192960612, LegendLabel = "General Motors" } );
pieSeries.Add( new DataPoint() { YValue = 0.151830229, LegendLabel = "Volkswagen" } );
pieSeries.Add( new DataPoint() { YValue = 0.125964366, LegendLabel = "Ford" } );
pieSeries.Add( new DataPoint() { YValue = 0.091152353, LegendLabel = "Honda" } );
pieSeries.Add( new DataPoint() { YValue = 0.079093251, LegendLabel = "Nissan" } );
pieSeries.Add( new DataPoint() { YValue = 0.079093251, LegendLabel = "PSA" } );
pieSeries.Add( new DataPoint() { YValue = 0.064697675, LegendLabel = "Hyundai" } );
             
chartArea.DataSeries.Add(pieSeries);
RadChart1.DefaultView.ChartLegend.UseAutoGeneratedItems = true;
RadChart1.DefaultView.ChartArea = chartArea;
RadChart1.DefaultView.ChartLegend.Header = "Legend test";

            
Giuseppe
Telerik team
 answered on 02 May 2011
1 answer
104 views
Its a defect in RadComboBox. 

1) Create an application 
2) Add RadComboBox in a window
3) in Code file just add one RadComboBoxItem to RadComboBox
4) Override the FontSize property in style something like

<Style TargetType="telerik:RadComboBox">
<Setter Property="FontFamily" Value="{x:Static ui:DefaultStyle.APP_FONT_FAMILY}"/>
<Setter Property="FontSize" Value="10.5"/>
<Setter Property="Height" Value="{x:Static ui:DefaultStyle.COMBO_BOX_HEIGHT}"/>
<Setter Property="telerik:StyleManager.Theme" Value="{x:Static ui:DefaultStyle.APP_THEME}"/>
</Style>

5) Run the application
6) click on radcombobox . Initially item looks blurred. And in few second it gets normal.

It happen only when u have one RadComboBoxItem.

Regards
Sanket
George
Telerik team
 answered on 02 May 2011
5 answers
201 views
How can i remove the border around the linked image.
Vanya Pavlova
Telerik team
 answered on 02 May 2011
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?