Telerik Forums
UI for WPF Forum
8 answers
317 views
When I remove a node (using the DEL key) I want its connections to be removed too. As it is now, I get these orphaned connections when removing a node.

This is the scenario:
1) Node A is connected - through connection X - to node B.
2) B is selected. I press the DEL key. Both B and X are removed.
3) I press Ctrl+Z. Both the removal of B and X are undone.

This behavior is absolutely necessary for our product. How can I accomplish this?
Petar Mladenov
Telerik team
 answered on 16 Sep 2013
1 answer
246 views
Hi,

I want to put the following RTB fir the LeftPage and rightPage for the book.

this is the Dictionary code where I created the Left and right pages for the book :

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <Style x:Key="myStyle" TargetType="Button">
            <Setter Property="Background" Value="Orange" />
            <Setter Property="FontStyle" Value="Italic" />
            <Setter Property="Padding" Value="8,4" />
            <Setter Property="Margin" Value="4" />
        </Style>
     
 
        <!--  Declare the template used for the left pages  -->
        <DataTemplate x:Name ="LeftPageTemplate"   >
            <StackPanel Margin="10" Background="LightGray">
 
               
            </StackPanel>
        </DataTemplate>
        <!--  Declare the template used for the right pages  -->
        <DataTemplate x:Name="RightPageTemplate" DataType="Grid"  >
            <StackPanel Margin="10" Background="LightBlue">
                <TextBlock HorizontalAlignment="Right"
                           FontSize="24"
                           FontWeight="Bold"
                           Text="{Binding Title}" />
                <Image Width="240"
                       Height="320"
                       Source="{Binding Image}" />
                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                    <TextBlock FontWeight="Bold" Text="Date Taken:" />
                    <TextBlock Text="{Binding DateTaken}" />
                </StackPanel>
                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                    <TextBlock FontWeight="Bold" Text="Size:" />
                    <TextBlock Text="{Binding Size}" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
 
      
 
</ResourceDictionary>



The problem is, How do I create the Template, I tried the example in the Help Document and it still do not work.
 I get the following error,
'Could not register named object. Names not supported under ResourceDictionary scope.' Line number '12' and line position '23

Please see attached image.

Regards,
Omar



o
Top achievements
Rank 2
 answered on 15 Sep 2013
5 answers
139 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
88 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
108 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
385 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
123 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.2K+ 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
66 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
192 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
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?