Telerik Forums
UI for WPF Forum
1 answer
89 views
We have recently bought the licence of the Telerik controls and I am trying to use the TreeListView. Is there a way to use a template selector to bind different collection of data?


Thanks
Kiran
Stefan Dobrev
Telerik team
 answered on 22 Jul 2010
10 answers
417 views
I am trying to use the NumericUpDown but I need to format the displayed value so as to not show anything after the decimal, i.e. I want whole numbers only. I cannot seem to find a text format property, so how can I achieve this?

Thanks,

blair
Valeri Hristov
Telerik team
 answered on 22 Jul 2010
1 answer
36 views
I used DatePicker control (version 2010.1.422.35) in my project and everything worked fine. And yesterday I updated the dlls to version 2010.2.0714.35, and then I found the datepicker cannot pick up a date.

Is this a know issue? or besides updating the dlls and the reference path in my projects, there is something else I need to update to make datepicker work correctly?

Thanks,
Yang Lu
Kaloyan
Telerik team
 answered on 22 Jul 2010
2 answers
151 views
I have a RadPane set to floatingdocked. I do not wish to display this pane when the application loads.
I wish to display this only when certain event is fired.
I tried to set the visibility to hidden on SplitContainer as well as RadPanegroup but it is still visible
George
Telerik team
 answered on 22 Jul 2010
1 answer
149 views
I'm trying to set both background an HorizontalAlignment on GridViewCells of a GridViewDataColumn at run time as follows:

Binding backgroundBinding = new Binding("Item.Format[" + column.UniqueName + "].Background");
Binding horizontalAlignmentBinding  = new Binding("Item.Format[" + column.UniqueName + "].HorizontalAlignment");

Style cellStyle = new Style(typeof(GridViewCell));
cellStyle.Setters.Add(new Setter(GridViewCell.BackgroundProperty, backgroundBinding));
cellStyle.Setters.Add(new Setter(GridViewCell.HorizontalAlignmentProperty, horizontalAlignmentBinding));
column.CellStyle = cellStyle

It works;  the point is that background color do not fill whole cell area but only a around cell content (see attached picture).
Same issue for VerticalAlignment.

Sincerely
Ivano
Milan
Telerik team
 answered on 22 Jul 2010
9 answers
254 views
Hello -
We have a column in a radgridview that is using a rectangle in the data template (WPF 3.5 app - Moving to .NET 4.0 is not a option right now.). This works fine normally, but running a VS 2010 Coded UI Test against the app when this grid is displayed causes our application to crash due to a null reference exception being thrown. Please advise.

Note: This causes our application to crash during QTP automated UI tests (what we normally use for automated UI testing) as well, so our automated testing in on hold until a fix is found.

By the way, UISpy doesn't like this either, but Snoop doesn't seem to have a problem with it.
Thanks.

GridView Column code:

<

 

telerik:GridViewColumn Header="" IsSortable="False" IsFilterable="False" TextAlignment="Center">

 

 

 

<telerik:GridViewColumn.CellTemplate>

 

 

 

<DataTemplate>

 

 

 

<Rectangle Height="18" Width="18"

 

 

HorizontalAlignment="Center" VerticalAlignment="Center"

 

 

Fill="AliceBlue"/>

 

 

 

</DataTemplate>

 

 

 

</telerik:GridViewColumn.CellTemplate>

 

 

 

</telerik:GridViewColumn>

 

 

 

Exception detail:

Event Type: Error
Event Source: RATS 3.0
Event Category: None
Event ID: 100
Date:  7/8/2010
Time:  11:26:50 AM
User:  N/A
Computer: 
Description:
Timestamp: 08-Jul-2010 3:26:50 PM
Message: HandlingInstanceID: c590513b-d517-41bf-88b5-b1304b1daab7
An exception of type 'System.NullReferenceException' occurred and was caught.
-----------------------------------------------------------------------------
07/08/2010 11:26:50
Type : System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : PresentationCore
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void EnsureChildren()
Stack Trace :    at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.ContextLayoutManager.fireAutomationEvents()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at WpfShell.App.Main() in C:\IS\TFSProd\CSS.Underwriting\Main\Rats3\Client\WpfShell\obj\Debug\App.g.cs:line 0

 

 

Milan
Telerik team
 answered on 22 Jul 2010
1 answer
112 views
im having a popup which contains two grid. when i placed code in separate xaml it works perfect. but when i placed the inside a popup. my popup info Content appear quit away from where my mouse pointer is. u can see attached image.

so how to position my info Contents under my mouse?
Miroslav
Telerik team
 answered on 21 Jul 2010
1 answer
166 views
Hello,
I'm having issues getting the treeview's functionalities to work when in LoadOnDemand , notably drag and drop and AutoExpand,
1) AutoExpand on drag doesn't work , if i remove the load on demand it works , however load on demand itself seems to work just fine
2) Droping doesn't seem to load the node either , when i drop on an unloaded node it opens with only the node i have droped instead of it's actual content.
Is this scenario supported, if so what am i doing wrong , else any tips on how to implement it? I am using the latest Q2 version and WPF 4 / VS 2010.
Thanks!

Full code (couldn't find how to properly paste code on forums , any tips most welcome):

XAML :

<

 

 

Window x:Class="RadControlsWpfApp1.MainWindow"

 

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

 

xmlns:Tree="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

 

 

 

 

Title="MainWindow" Height="350" Width="525">

 

 

 

 

 

<Grid>

 

 

 

 

 

<!--If you uncomment the line , autoexpand works just fine-->

 

 

 

 

 

<Tree:RadTreeView ItemsSource="{Binding Items}"

 

 

 

 

IsLoadOnDemandEnabled="True"

 

 

 

 

LoadOnDemand="RadTreeView_LoadOnDemand"

 

 

 

 

IsDragDropEnabled="True">

 

 

 

 

 

<Tree:RadTreeView.ItemTemplate>

 

 

 

 

 

<HierarchicalDataTemplate ItemsSource="{Binding Children}">

 

 

 

 

 

<TextBlock Text="{Binding Name}"></TextBlock>

 

 

 

 

 

</HierarchicalDataTemplate>

 

 

 

 

 

</Tree:RadTreeView.ItemTemplate>

 

 

 

 

 

</Tree:RadTreeView>

 

 

 

 

 

</Grid>

 

</

 

 

 

Window>

 

 


Code behind:

using

 

 

System;

 

 

using

 

 

System.Collections.Generic;

 

 

using

 

 

System.Windows;

 

 

using

 

 

System.Windows.Navigation;

 

 

using

 

 

Telerik.Windows.Controls;

 

 

using

 

 

System.ComponentModel;

 

 

namespace

 

 

RadControlsWpfApp1

 

{

 

 

 

public partial class MainWindow : Window

 

 

{

 

 

public MainWindow()

 

{

InitializeComponent();

 

 

 

this.DataContext = this;

 

Items =

 

 

new List<object>(){

 

 

 

 

new Item{Id = 1 , Name = "1"},

 

 

 

 

new Item{Id = 2 , Name = "2"},

 

 

 

 

new Item{Id = 3 , Name = "3"},

 

 

 

 

new Item{Id = 4 , Name = "4"},

 

 

 

 

new Item{Id = 5 , Name = "5"}

 

};

}

 

 

 

public List<object> Items { get; set; }

 

 

 

 

private void RadTreeView_LoadOnDemand(object sender, Telerik.Windows.RadRoutedEventArgs e)

 

{

 

 

 

RadTreeViewItem item = e.OriginalSource as RadTreeViewItem;

 

 

 

 

var Current = item.Item as Item;

 

Current.Children =

 

 

new List<object>(){

 

 

 

 

new Item{Id = 1 , Name = "1"},

 

 

 

 

new Item{Id = 2 , Name = "2"},

 

 

 

 

new Item{Id = 3 , Name = "3"},

 

 

 

 

new Item{Id = 4 , Name = "4"},

 

 

 

 

new Item{Id = 5 , Name = "5"}

 

};

item.IsLoadingOnDemand =

 

 

false;

 

}

}

 

 

 

public class Item : INotifyPropertyChanged

 

 

{

 

 

public int Id { get; set; }

 

 

 

 

public string Name { get; set; }

 

 

 

 

List<object> children = new List<object>();

 

 

 

 

public List<object> Children

 

{

 

 

 

get

 

 

{

 

 

return children;

 

}

 

 

 

set

 

 

{

children =

 

value;

 

PropertyChange(

 

 

"Children");

 

}

}

 

 

 

 

public event PropertyChangedEventHandler PropertyChanged = (a, b) => { };

 

 

 

 

public void PropertyChange(string propertyName)

 

{

 

 

 

this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

 

}

}

}

 

Miroslav
Telerik team
 answered on 21 Jul 2010
1 answer
433 views
If I put a
<telerik:RadTransitionControl />
element on the windows I am starting to get these kind of errors:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Foreground.Color; DataItem=null; target element is 'DropShadowEffect' (HashCode=31421563); target property is 'Color' (type 'Color')

Note that transition control is empty (no content) and the error originates from a style I have somewhere defined. I assume transition control does something with styles.
Not also that this isn't a stopping error but rather an annoyance in output window.
George
Telerik team
 answered on 21 Jul 2010
2 answers
104 views
Hi, I'm using Xaml to design my PanelBar. I want to set defined properties to my PanelBarItems when they are expanded and when they are selected. I found some code on an other thread but it doesn't seem to be compatible with the PanelBar. Here is the code:
<Style TargetType="{x:Type telerik:RadPanelBarItem}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerik:RadPanelBarItem}">
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="FontSize" Value="25" />
                                </Trigger>
                                <Trigger Property="IsExpanded" Value="True">
                                    <Setter Property="FontWeight" Value="Italic" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

Can you tell me how to set the HeaderTemplate and his trigger?
I'm using WPF controls Q2 2010
Thanks
Jean-Francois
Top achievements
Rank 1
 answered on 21 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?