Telerik Forums
UI for WPF Forum
1 answer
123 views
I'm trying to display some of the Data as Text in my TimelineItems, but all my Template can access is an Object of type TimelineDataItem

System.Windows.Data Error: 40 : BindingExpression path error: 'Iteration' property not found on 'object' ''TimelineDataItem'

TimelineDataItem has no Property that holds the original value object. In the ToolTip I can access the original Data object, though.
Can anyone tell me please how I can get the original Data in the template?

                                        <ControlTemplate TargetType="{x:Type telerik:TimelineItemControl}">
                                            <Border Background="#01FFFFFF" Height="30" Margin="0,5,0,0">
                                                <Grid>
                                                    <Rectangle x:Name="timelineItem" Height="29" Stroke="#FFCBCBCB" VerticalAlignment="Center">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                <GradientStop Color="#FF4786AA" Offset="0"/>
                                                                <GradientStop Color="#FF163D59" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <TextBlock Text="{Binding Path=Iteration.Name}"></TextBlock>
                                                </Grid>
                                            </Border>
                                        </ControlTemplate>
Tsvetie
Telerik team
 answered on 28 Dec 2012
0 answers
140 views
 Hi:
    I want to expand all children of one parent note, but the children rows do not show. Detailed information please read from the attachment. Please give me a help.
    Thanks.

Attachment
Joke
Top achievements
Rank 1
 asked on 28 Dec 2012
0 answers
73 views
Hi:
      I want to expand all children of one parent note, but the children rows do not show. Detailed information please read from the attachment.

Thanks.
Joke
Top achievements
Rank 1
 asked on 28 Dec 2012
1 answer
69 views
Hi,
Am I able to freeze rows in the TreeListView ?

Best regards & have a nice holidays :)
Kristján.
Vlad
Telerik team
 answered on 28 Dec 2012
0 answers
79 views
Hey guys
I am newbie in Telerik WPF Dev, I have a trouble with implementation of telerik already prepared examples. For example here is one link

http://demos.telerik.com/silverlight/#GridView/Selectors/StyleSelectors/RowStyleSelector

Under the code we can notice

xmlns:Examples="clr-namespace:Telerik.Windows.Examples"

and further down xaml tag

<Examples:UnitPriceConveter x:Key="converter" />

How to get access to that 'Examples',
how to implement the example to make it work with my DataTable as my DataSource.
I could not find any info of how to make these examples to work with DataTable.

If you will explain or provide at least one example of how to go around that 'Examples:' tag and of how to use DataTable as DataSource I will be ok

Thanks
 
Lukasz
Top achievements
Rank 1
 asked on 27 Dec 2012
4 answers
133 views
I have a RadDataForm that contains a number of fields.

When I add a DataFormDateField and bring up the form in ReadOnly mode, the field is disabled.  When I add a DataFormDataField that contains a RadDateTimePickerand bring up the form in ReadOnly mode, the field is not disabled.

In other words, this works:
<telerik:DataFormDateField
    Label="Contact Date"
    DataMemberBinding="{Binding Path=contactdt}"
    />

And this does not:
<telerik:DataFormDataField
    Label="Contact Date"
    >
    <telerik:RadDateTimePicker
        SelectedValue="{Binding Path=contactdt}"
    />
</telerik:DataFormDataField>

Is there a way to get a DataFormDataFields contained controls to respond to the form's Mode?
Jeff
Top achievements
Rank 1
 answered on 27 Dec 2012
1 answer
320 views
Hi,

The following works when the context menu is declared in the TreeView directly.
<telerik:RadTreeView Name="radTreeView" ExpanderStyle="{StaticResource ExpanderStyle}" ItemsSource="{Binding Path=EnvironmentMenuDataSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemTemplate="{StaticResource EnvironmentMenu}">
                                    <telerik:RadContextMenu.ContextMenu>
                                        <telerik:RadContextMenu Opened="RadTreeViewContextMenuOpened">
                                            <telerik:RadMenuItem Header="{Binding Path=SelectedItem.ContextCommandName}"  Command="{Binding Path=ViewListCommand}" CommandParameter="{Binding SelectedItem}">
                                                <telerik:RadMenuItem.Icon>
                                                    <Image Source="../Images/Menu/Blue.png" Stretch="Uniform" />
                                                </telerik:RadMenuItem.Icon>
                                            </telerik:RadMenuItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadContextMenu.ContextMenu>
                                </telerik:RadTreeView>

However when placed my context menu inside the Data template as I only want a context menu with leave items,
<DataTemplate x:Key="EntityMenu">
           <Grid>
               <Grid.ColumnDefinitions>
                   <ColumnDefinition Width="0.35*"/>
                   <ColumnDefinition Width="0.65*"/>
               </Grid.ColumnDefinitions>
               <Image Source="{Binding ImageUrl, Mode=OneWay}" Width="16" Height="16"/>
               <TextBlock Margin="3,0,0,0" Grid.Column="1" TextWrapping="Wrap" Text="{Binding Name, Mode=OneWay}">
                    <telerik:RadTreeView Name="radTreeView" ExpanderStyle="{StaticResource ExpanderStyle}" ItemsSource="{Binding Path=EnvironmentMenuDataSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemTemplate="{StaticResource EnvironmentMenu}">
                                   <telerik:RadContextMenu.ContextMenu>
                                       <telerik:RadContextMenu Opened="RadTreeViewContextMenuOpened">
                                           <telerik:RadMenuItem Header="{Binding Path=SelectedItem.ContextCommandName}"  Command="{Binding Path=ViewListCommand}" CommandParameter="{Binding SelectedItem}">
                                               <telerik:RadMenuItem.Icon>
                                                   <Image Source="../Images/Menu/Blue.png" Stretch="Uniform" />
                                               </telerik:RadMenuItem.Icon>
                                           </telerik:RadMenuItem>
                                       </telerik:RadContextMenu>
                                   </telerik:RadContextMenu.ContextMenu>
                               </telerik:RadTreeView>
               </TextBlock>
           </Grid>
       </DataTemplate>
       <HierarchicalDataTemplate x:Key="EnvironmentMenu" ItemTemplate="{StaticResource EntityMenu}"
          ItemsSource="{Binding EntityMenus}">
           <TextBlock Text="{Binding Name}" />
       </HierarchicalDataTemplate>

it does not work anymore. I tried to change the binding with the relativesouce but no luck. we are using the MVVM. The commands are in the ViewModel of the view.

Do you have any examples with it?

Thanks
Pavel R. Pavlov
Telerik team
 answered on 27 Dec 2012
8 answers
217 views
Hi,

I experienced a problem in my developing the WPF application. The application consists of a RadScheduleView and many WPF Hyperlink items. Once the ScheduleView is on focus, then I click on any Hyperlink, the application hangs and shows "InvalidOperationException" in Debug mode, saying that Hyperlink is not a Visual or Visual3D.

Full stacktrace is captured as follow:
System.InvalidOperationException was unhandled
  Message='System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.
  Source=PresentationCore
  StackTrace:
       at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
       at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
       at Telerik.Windows.Controls.ScheduleViewBase.ScheduleViewLostFocus(Object sender, RoutedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.InlineEditing.cs:line 368
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.OnLostFocus(RoutedEventArgs e)
       at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
       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, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
       at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
       at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       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, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.FrameworkContentElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
       at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
       at System.Windows.ContentElement.Focus()
       at System.Windows.Documents.Hyperlink.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       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.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       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, WindowMessage 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, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       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.Application.RunInternal(Window window)
       at System.Windows.Application.Run()
       at WpfApplication1.App.Main() in C:\Segantii\Development\Samples\Telerik\MonthViewTickStyle\WpfApplication1\WpfApplication1\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

There will be no error if I click other UI element (e.g. TextBox) after ScheduleView is on focus.
And I cannot find the way to catch the Exception, thus the application will hang once user click on Hyperlink after ScheduleView is on focus.

Is that a bug?
Thanks a lot!

Frankie
Vladi
Telerik team
 answered on 27 Dec 2012
1 answer
111 views
Hi. I implement IDataErrorInfo in my ViewModel's class. I use RadDataForm that bind to simple source from viewmodel. When i start project i have exception (TargetParameterCountException Parametr count mismatch). What is wrong?
Alex
Top achievements
Rank 1
 answered on 27 Dec 2012
5 answers
278 views
Hi,

we would like to create a CustomControl that derives from a RadComboBox with a special ItemTemplate. On our first approach we tried it with a usual combox by adding to following lines to the Generic.xaml file of the project:
<Style TargetType="{x:Type local:ComboBoxLookupDataMaterialMainGroups}" BasedOn="{StaticResource {x:Type ComboBox}}">
    <Setter Property="ItemTemplate">
        <Setter.Value>
            <DataTemplate >
                 Individual Template Definition
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

It worked as expected so we changed the baseclass of the custom control to a RadComboBox, searched for the correct "BasedOn" content and changed it to:
<Style TargetType="{x:Type local:ComboBoxLookupDataMaterialMainGroups}" BasedOn="{StaticResource RadComboBoxStyle}">

Because the RadComboBoxStyle was unknown, we also added the implicit theme XAMLs
  • Telerik.Windows.Controls.XAML and
  • Telerik.Windows.Controls.Input.XAML

to the project's theme folder and added the following includes to the Generic.XAML:
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Telerik.Windows.Controls.xaml" />
    <ResourceDictionary Source="Telerik.Windows.Controls.Input.xaml" />
</ResourceDictionary.MergedDictionaries>

The whole project is just a WPF control assembly that is used by another WPF application project, so it doesn't contain an App.xaml file.

After starting the application it hangs with a XAMLObjectWriterException: Zeilennummer "7" und Zeilenposition "10" von "Beim Festlegen der Eigenschaft "System.Windows.ResourceDictionary.Source" wurde eine Ausnahme ausgelöst.".

Maybe it's just a small missing piece but it also might be a fundamental lack of knowledge since we are new to WPF. Could you please help us out?

Thanks!
David
Yana
Telerik team
 answered on 27 Dec 2012
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?