Telerik Forums
UI for WPF Forum
5 answers
134 views
Recently, I've been working on a prototype to binding ADO.NET object to RadTreeListView for our project.
I have one DataSet which contains one DataTable. This table has 3 columns: ID, ParentID and Description. Create relation for this table between ID and ParentID columns. In another word, this is a self-referenced table.
Now create one DataView upon this DataTable and add needed filter for it.
1. Use the data set as the DataSource of RadTreeListView
2. Binding data view to ItemSource of RadTreeListView
3. Binding relation to ItemsSource of ChileTableDefinitions
See following codes:
<telerik:RadTreeListView Name="radTreeListView_left" DockPanel.Dock=

"Left" ItemsSource="{Binding TreeVM}" SelectedItem="{Binding SelectedEntityRow}">

 

 

<telerik:RadTreeListView.ChildTableDefinitions>

 

  <telerik:TreeListViewTableDefinition ItemsSource="{Binding Source=DataSetVM, Path=TreeRelation}"/>

 

</telerik:RadTreeListView.ChildTableDefinitions>

 

 

</telerik:RadTreeListView>

 

 

The hierarchy data can be display correctly in TreeListView. Since I am binding the data view to UI with Two Way mode, so I think if I detele one row in data view, the UI will be updated accordingly. But actually, only delete a root item can refresh correctly. Delete sub items on UI cannot refersh, they need additional refersh manually. For example, I have following structure in TreeListView:
Group 1
   |_Item 1
   |_Item2
Group 2
Delete Group2 in DataSet, UI will remove Group 2 automatically. But if I remove Item 2 in DataSet, UI will not update unless I refersh UI manually. 
So my question is does anybody know how to solve this sub items refersh problem? This is very important for us to decide if choose Telerik or not. So please give any clue you may have.

Nagaraj
Top achievements
Rank 1
 answered on 15 Sep 2013
0 answers
76 views
Dear Sir

I have a table(in SQL), like this: (there are some hierarchical data in this table)

ID    F_ID        Title 
1       0          Hardware
2        1          Laptop
3        2           Sony
4         2          Toshipa
5         2          Asus
6        1            Monitor
7         6            LG
8         6             Samsung

I have used the RadGridview for hierarchical  this data.
The XAML code is:

<telerik:RadGridView Grid.Row="1"  Name="radGridView1"  ShowGroupPanel="False"  AutoGenerateColumns="False"  ItemsSource="{Binding}"  >
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
                    <telerik:GridViewTableDefinition.Relation>
                        <telerik:TableRelation IsSelfReference="True">
                            <telerik:TableRelation.FieldNames>
                                <telerik:FieldDescriptorNamePair
                            ParentFieldDescriptorName="ID"
                            ChildFieldDescriptorName="F_ID" />
                            </telerik:TableRelation.FieldNames>
                        </telerik:TableRelation>
                    </telerik:GridViewTableDefinition.Relation>
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" IsGroupable="False" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding F_ID}" IsGroupable="False" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}" IsGroupable="False" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

and the C# code is:

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            MyLinqObjDataContext db = new MyLinqObjDataContext();
            radGridView1.ItemsSource = db.TBLTests;

        }

and the result of these code is shown in R1.png (attached file).

Now, Could you allow me to know:

1) How I could hide the "Laptop", "Sony", "Toshiba", "Asus" from root of radGridView. Because they are the child of "Hardware", I want to see them ONLY when  the "Hardware" item, is expanded.

2) How I could hide the "+" icon, from beside of "Sony", "Toshiba", "Asus". Because they have not child (not expandable).


I am waiting for your help, PLEASE?
thanks;
 





Hossein
Top achievements
Rank 1
 asked on 14 Sep 2013
0 answers
100 views
Dear Sir

Could you convert this St. from Vb.net to C# please?

Dim objParams As Object() = {DirectCast(DirectCast(row.DataContext(), System.Object), System.Data.DataRow).ItemArray(0)} 

Thanks






Hossein
Top achievements
Rank 1
 asked on 14 Sep 2013
1 answer
368 views
Hello, I'm trying to do a project where I have a few checkboxes that correspond to different series. When the checkbox is checked, the series is displayed, and if the checbox is unchecked, the series is collpased. There are two problems with this:

1) The legend still shows the collapsed series
2) The values on the Y axis are not recalculated as the series go away. For example: If series "A" has max value is 5000, and series "B" max value is 250, when hiding "A" the Y values keep showing all the way up to 5000.

How can I fix these two problems?

Thank you,

- Carlo
Petar Kirov
Telerik team
 answered on 14 Sep 2013
7 answers
114 views

I am leveraging the WPF Telerik libraries for a simple Tab control. Weird enough the exact same code/solution works on my personal computer but gives the following error on my office machine:

Code

<Window x:Class="WpfApplication1.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"
    Title="MainWindow" Height="350" Width="900">
<Grid>
    <telerik:RadTabControl>
        <telerik:RadTabItem Header="Dashboard Summary" Width="200" Background="Gray">
        </telerik:RadTabItem>
        <telerik:RadTabItem Header="Details" Width="200" Background="Gray"  />
        <telerik:RadTabItem Header="Policy Tester" Width="200" Background="Gray"  />
    </telerik:RadTabControl>
</Grid>
</Window>

The exact same 3 libraries are being referenced but the same code on my office machine renders the tabs but doesnt give me intellisense and keeps throwing the following error:

Tina Stancheva
Telerik team
 answered on 13 Sep 2013
1 answer
1.1K+ views
<telerik:RadMaskedNumericInput Value="{Binding Quantity, Mode=TwoWay}">
    <telerik:RadMaskedNumericInput.InputBindings>
        <KeyBinding Key="Enter" Command="{Binding DoSomethingCommand}" />
        <KeyBinding Key="Tab" Command="{Binding DoSomethingCommand}" />
    </telerik:RadMaskedNumericInput.InputBindings>
</telerik:RadMaskedNumericInput>
I am trying to call to a command when the Enter key is pressed like an exemple above.
The Tab KeyBinding works perfectly, but the Enter doesn't work.

This behavior works in a TextBox, is this possible in a MaskedInput?
Method
Top achievements
Rank 1
 answered on 13 Sep 2013
0 answers
62 views
Dear Sir

I want to save the family relationship (My Name, my Father's Name, My grandfather's name, and father name of my grandfather).
(5 Levels)
So, I have a SQL table with these columns (ID, F_ID ,Name).

ID    F_ID     Name
1      0          John
2      1          John1
3      1          John2
....
...
...

Could you allow me to have a project in C# that shows this issue in RadDataGrid please?
I study the RadDataGrid hierarchial child rows, but I could not create a project.
Hossein
Top achievements
Rank 1
 asked on 13 Sep 2013
2 answers
179 views
Dear support,

I have the problem, that I want to set the instantitem height to the actualheight of the timeline.
The problem is that if the instantitem height extends the height of the 'normal' items, my timeline extends it's height -> can see it on the vertical scrollbar.
Is there a way to set the instant item height to the actual height of the timeline? 
The reason is that we want to see the instant items even when the user scrolls down.
I have attached an image with the desired behavior.

You can test the the bevavior with that small piece of code:

XAML
<Window
    x:Class="WpfApplication1.MainWindow"
    x:Name="Window"
    Title="MainWindow">
    <Window.Resources>
        <DataTemplate x:Key="InstantItemTemplate">
            <Rectangle Width="7" Height="{Binding ElementName=slider1, Path=Value}" Fill="Red" />
        </DataTemplate>
 
        <DataTemplate x:Key="ItemWithDurationTemplate">
                <Rectangle Margin="0, 0, 0, 5" Height="20" VerticalAlignment="Center" Fill="Green"/>
        </DataTemplate>
    </Window.Resources>
    <DockPanel LastChildFill="True">
        <StackPanel DockPanel.Dock="Top">
            <StackPanel Orientation="Horizontal">
                <Slider Minimum="1" Maximum="1500" Value="{Binding ElementName=sliderTextBox, Path=Text, Mode=TwoWay}" TickFrequency="1" Name="slider1" Width="600" />
                <TextBox Name="sliderTextBox" Text="{Binding ElementName=slider1, Path=Value}" />
            </StackPanel>
            <TextBlock Text="{Binding ElementName=slider1, Path=Value}" FontSize="20" FontWeight="Bold" Height="25" HorizontalAlignment="Center" />
        </StackPanel>
        <telerik:RadTimeline x:Name="timeline"
                Margin="6"
                VerticalAlignment="Top"
                PeriodStart="2011/01/01" PeriodEnd="2011/06/01"
                VisiblePeriodStart="2011/01/01" VisiblePeriodEnd="2011/03/22"
                StartPath="Date"
                DurationPath="Duration"
                VerticalScrollBarVisibility="Auto"
                TimelineItemTemplate="{StaticResource ItemWithDurationTemplate}"
                TimelineInstantItemTemplate="{StaticResource InstantItemTemplate}">
            <telerik:RadTimeline.Intervals>
                <telerik:DayInterval />
                <telerik:WeekInterval />
                <telerik:MonthInterval />
                <telerik:YearInterval />
            </telerik:RadTimeline.Intervals>
        </telerik:RadTimeline>
    </DockPanel>
</Window>



CS
using System;
using System.Collections.Generic;
using System.Windows;
 
namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private List<Item> dataSource;
        private DateTime startDate;
 
        public MainWindow()
        {
            InitializeComponent();
 
            dataSource = new List<Item>();
            startDate = new DateTime(2011, 1, 1);
            var endDate = new DateTime(2011, 6, 1);
 
            Random r = new Random();
            for (DateTime i = startDate; i < endDate; i = i.AddMonths(1))
            {
                for (int j = 0; j < 20; j++)
                    dataSource.Add(new Item() { Date = i, Duration = TimeSpan.FromDays(r.Next(50, 100)) });
            }
            dataSource.Add(new Item() { Date = startDate.AddMonths(3).AddDays(15) });
            timeline.ItemsSource = dataSource;
            timeline.VisiblePeriodStart = startDate.AddDays(20);
            timeline.VisiblePeriodEnd = endDate.AddDays(-20);
        }
    }
 
    public class Item
    {
        public TimeSpan Duration { get; set; }
        public DateTime Date { get; set; }
    }
}




Regards,
Wolfgang
Wolfgang
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
254 views
Hi,
I want to use a RowStyleSelector in a RadGridView to make rows Expandable or not depends on the value of a column of my ItemSource.
ItemSource is a Dataset that contains a DataTable (ID, Name, Type, SerialNumber, ...).
I need to make rows expandable if the Type ='Updated'.

My actual code (below) is not working:
 
<telerik:RadGridView.RowStyleSelector>
                          <telerik:ConditionalStyleSelector>
                                <telerik:StyleRule Condition="Type = Updated">
                                    <Style TargetType="rad:GridViewRow">
                                        <Setter  Property="IsExpandable" Value="False" />
                                    </Style>
                                </telerik:StyleRule>
                            </telerik:ConditionalStyleSelector>
                      </telerik:RadGridView.RowStyleSelector> 


Yoan
Telerik team
 answered on 13 Sep 2013
1 answer
263 views
I'm evaluating the PDF Viewer and it works great! However, when I try to use the code for the thumbnail demo as a starting point in my application I'm getting an exception. The code I'm using is that which you can copy and paste from the Telerik WPF Controls Examples application, where you can switch between Example and Code.

Is it possible to get the actual .csproj project for the PDF thumbnail viewer sample?

Thank you.
Petya
Telerik team
 answered on 13 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?