Telerik Forums
UI for WPF Forum
6 answers
467 views
Hi, I am having a little problem with databinding against the Treeview in WPF.

This is my data template

 <DataTemplate x:Key="TreeParameterDataTemplate" DataType="TreeParameter">  
            <StackPanel>                  
                <Telerik:RadTreeView  
                 VerticalAlignment="Top" 
                 HorizontalAlignment="Left" 
                 MinHeight="100" 
                 x:Name="myTreeview" 
                 Margin="0, 0, 20, 0" 
                 SelectionMode="Single" 
              
                 SelectedValuePath="{Binding Path=ParameterValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                 ItemsSource="{Binding Path=Nodes, Mode=Default}" 
                 ItemTemplate="{DynamicResource ValidValueNodeDataTemplate}" 
                 IsTriStateMode="True" 
                 IsOptionElementsEnabled="True" 
                 ItemsOptionListType="CheckList">  
            </Telerik:RadTreeView> 
                <!--<ListBox ItemTemplate="{DynamicResource ValidValueNodeDataTemplate}"  ItemsSource="{Binding Path=Nodes, Mode=Default}" />--> 
            </StackPanel> 
    </DataTemplate> 

It seams to be the SelectedValuePath that is causing the problem. It should be a string, and ParameterValue is a string, but I get the following error:

System.InvalidOperationException was unhandled  
  Message="Syntax error in PropertyPath 'Syntax error in Binding.Path '[Business Hierarchy].[Power Pack Hierarchy].[Power Pack Description].&[Aggreko International]' ... '&[Chile]&[1]'.'." 
  Source="PresentationFramework" 
  StackTrace:  
       at System.Windows.PropertyPath.PrepareSourceValueInfo(ITypeDescriptorContext typeDescriptorContext)  
       at System.Windows.PropertyPath..ctor(String path, Object[] pathParameters)  
       at Telerik.Windows.Controls.RadTreeView.GetSelectedValuePathBinding()  
       at Telerik.Windows.Controls.RadTreeView.UpdateSelectedValue()  
       at Telerik.Windows.Controls.RadTreeView.SelectionChanger_SelectionChanged(Object sender, SelectionChangedEventArgs e)  
       at Telerik.Windows.Controls.SelectionChanger`1.InvokeSelectionChangedEvent()  
       at Telerik.Windows.Controls.SelectionChanger`1.End()  
       at Telerik.Windows.Controls.SelectionChanger`1.InsertItem(Int32 index, T item)  
       at System.Collections.ObjectModel.Collection`1.Add(T item)  
       at Telerik.Windows.Controls.RadTreeViewItem.OnIsSelectedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)  
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)  
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)  
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)  
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)  
       at Telerik.Windows.Controls.RadTreeViewItem.set_IsSelected(Boolean value)  
       at Telerik.Windows.Controls.RadTreeView.SetSelectedItem(RadTreeViewItem itemContainer)  
       at Telerik.Windows.Controls.RadTreeView.HandleItemSelectionFromUI(RadTreeViewItem itemUnderCursor)  
       at Telerik.Windows.Controls.RadTreeViewItem.OnHeaderMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)  
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)  
       at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)  
       at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)  
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)  
       at System.Windows.Input.InputManager.ProcessStagingArea()  
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)  
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)  
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
       at System.Windows.Interop.HwndSource.InputFilterMessage(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 Aggreko.ABI.ABIReportViewer.Application.Main() in C:\Working\Workspaces\ATFS01\Sirius\DEV\R699\Aggreko.ABI.ABIReportViewer\obj\Debug\Application.g.vb:line 73  
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)  
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)  
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)  
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()  
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)  
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)  
       at System.Activator.CreateInstance(ActivationContext activationContext)  
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()  
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)  
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)  
       at System.Threading.ThreadHelper.ThreadStart()  
  InnerException:   
 

Help...
Valentin.Stoychev
Telerik team
 answered on 28 Jul 2008
9 answers
176 views
Hi,

we own a "RadControls for ASP.NET AJAX+WinForms+Reporting" subscription.

While your Silverlight and WPF controls are still beta some of your competitors (like infragistics, xceed and so on) offer allready complete suites (even with charts and a lot more controls).

Our question is when and what we have to expect.
We are on some customer projects in WPF - Silverlight will follow.

We have some possibilities now:
a.) Buy a suite from a different vendor
++Available NOW (in Versions greater 1.x - so stable)
--We don't know them and have (almost) good experiences with you
--Extra cost - maybe!!
b.) Wait for you
++Well known things
++Extremly good Experiences with ASP Suite
++Good support (Except Winforms)
--Lots of problems with Winforms - maybe the same with WPF
--Donno when we get releases
--Donno what will be in or when we get (for an example) chart
??Save a lot of money --- if about 1.000 means a lot off :)

A primary question is if WPF and Silverligt will be included in the
"RadControls for ASP.NET AJAX+WinForms+Reporting" subscription.

And will the quallity stay on the ASP controls level or be as problematic as with Winforms (OK - question not answerable).

The thing with ASP - this was the first product we purchased - and we had (very little) problems - AND they have been solved very quickly.
With Winform there are a lot of problems - and some of them not solved over two releases!!!
Just a few things occuring to us:
Button - not working with "DialogResult"
TabPages - strange navi keys.
Panels - not copying all conctent (copy a well done panel to another form for an example).
Textbox - ShitTab does not work.
Listbox - problems in layout; no "Selected Item" like the Winforms LB.
Docking - Minsize ignored, FixedSplitters ignored
Combobox Dropdown overriding style set in designer.
AND SO ON

But I'll stop these things here.

In short words:
Will WPF and Silverligt be included in the
"RadControls for ASP.NET AJAX+WinForms+Reporting" subscription?
Will you provide (soon - or with release) Chart for WPF?
Do you have any idea about a release date?

Regards

Manfred
Nikolay
Telerik team
 answered on 25 Jul 2008
1 answer
114 views
I have a column that is stored as Y/N in our database. I would like to use a checkbox to display this but I don't see any converters.

We previously used the Infragistics Grid and it supported this feature. Is this something you will be supporting in the future?
Hristo Deshev
Telerik team
 answered on 25 Jul 2008
1 answer
80 views
Hi,
I have some questions - I've looked in the examples but couldn't find the answers. Maybe you should extend your "Columns" example with this.

I have a Datagrid bound to a datasource.
In one column I have a unbound Button
In another column I have a unbound ComboBox

Both inserted via a ControlTemplate

1) When clicking the Button how do I know which row was clicked?
I use the DataGrid.CurrentRecord property - and that seems to work ok. Through casts I can get the primaryID of the row.
But is that the preferred way to do it. And is it a reliable way?

2) In the button click event: How do I access the ComboBox in the current row. I've tried doing it through the CurrentRecord property . but seems to focus more on the datasource rows - and not on the rendered rows and cells. How do I do that ?

3) Do you ship documentation with the Release 1.0 at the end of July ?
Milan
Telerik team
 answered on 24 Jul 2008
3 answers
138 views
I was happily using the wpf beta 1 and developing a project prototype.  When the beta 2 was released I uninstalled beta 1 and installed beta 2 with the samples. Now when I try to drag a radgridview or gridviewdatacontrol onto the design surface in vs 2008 I get an "object reference not set to an instance of an object" error message.
I'm also getting error messages when i try to run the samples the error messages are
An error has occurred wide establishing a comection to the server. when cornectting to
sQL Server 2005, this failure may be caused by the Fact that under the default setttings
sQL sever does allow remote connections. (provider: Named Pipes Provider, error:
40
- Could not open a comection to SQL Server)

and it appears it is trying to access a non existent instance of SQLExpress.  Can anyone help with these issues?
Thanks for any assistance
Nedyalko Nikolov
Telerik team
 answered on 21 Jul 2008
1 answer
87 views
Good day,

I would like to know if the WPF grid control will support these features in its first release:

1- Working in a totally unbound mode (ie: AddRows, AddColumns, SetValue (row, column), etc).

2- Support joining cells to make up a seamless "bigger cell" (for example, to make multiple columns spawning headers, etc). (ex: http://cid-9eeb57eb098c0598.skydrive.live.com/self.aspx/Images/JoinedCells.JPG)

3- Locking rows and columns for scrolling.

Thank-you :)
Hristo Deshev
Telerik team
 answered on 17 Jul 2008
4 answers
111 views
Hi,

I have a controltemplate on a column.
<ControlTemplate x:Key="ComboBoxColumnTemplateReportService" TargetType="{x:Type Telerik:GridViewCell}">  
            <StackPanel Orientation="Horizontal">  
                    <ComboBox Width="150" Height="Auto" VerticalAlignment="Center" Margin="0,0,0,0" x:Name="dtcReportService" DataContext="{StaticResource objectDataProviderReportServices}" ItemsSource="{Binding}" DisplayMemberPath="Name"  /> 
                    <ComboBox Width="150" Height="Auto" VerticalAlignment="Center" Margin="8,0,0,0" x:Name="dtcPrinter" DataContext="{Binding Path=SelectedItem.Printers, ElementName=dtcReportService, Mode=Default}" ItemsSource="{Binding}" DisplayMemberPath="Name" /> 
                    <ComboBox Width="150" Height="Auto" VerticalAlignment="Center" Margin="8,0,0,0" x:Name="dtcPrinterTray" DataContext="{Binding Path=SelectedItem.PrinterTrays, ElementName=dtcPrinter, Mode=Default}" ItemsSource="{Binding}" DisplayMemberPath="Description" /> 
            </StackPanel> 
        </ControlTemplate> 

Now i want to access the template while looping my rows so i can get the selected values from my comboboxes (per row).

How can i do this?

Regards
NS
Top achievements
Rank 1
 answered on 15 Jul 2008
2 answers
91 views

The ItemSource of my RadCarousel is a datatable (which is capable of databinding according to MS).  I've added a TextBox control to my XAML definition for the ControlTemplate for the CarouselDataRecordPresenter as per the following code:

<

StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
    
<TextBox Text="{Binding Path=Fields[Answer].Value, Mode=TwoWay,
        
UpdateSourceTrigger=PropertyChanged}" FontSize="12" Foreground="Black"
        
Width="216" />
</StackPanel>

The carousel is displaying the values from the DataTable fine, but the TextBox.Text is not successfully updating the DataTable's "Answer" column.

Note that I have specified TwoWay binding (should not be necessary because that is the default mode for the TextBox control) as well as the UpdateSourceTrigger property of the binding (just to test).

This is a really annoying problem!  Now I have to try to programatically determine what the TextBox.Text value is and manually update the datasource.  Any direction on where to start doing so would be most helpful.

Milan
Telerik team
 answered on 14 Jul 2008
3 answers
107 views
As far as I can determine, the RadCarousel control does not work in WPF Browser applications.  I started my current project as a WPF Browser app and after hours of not being able to get RadCarousel to work, I copied & pasted my XAML and C# code into a WPF application and it worked just fine.

Can you confirm that this is a problem, and whether it is expected to be addressed before release?
Craig Cote
Top achievements
Rank 2
 answered on 12 Jul 2008
3 answers
111 views
Copied from my XAML code:

<

Style TargetType="{x:Type Telerik:CarouselItem}">
    <Setter Property="Template" >
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Telerik:CarouselItem}">
                <Grid ClipToBounds="False" Height="175" Width="350" >

Strangely, the Width property on the last line does make my carousel items wider/narrower, but the Height property does not.  Is this an issue (and thus subject to being fixed) or is it broken by design?

Craig Cote
Top achievements
Rank 2
 answered on 11 Jul 2008
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?