Telerik Forums
UI for WPF Forum
2 answers
214 views
Hi,

I am new to this telerik controls. I want to have multiple children, which are of having different number of columns and values. I will be binding the complete collection as observable collection through model, since i am using MVVM model with WPF. Collection can have 'n' number of parents, each parent will have two children, These two children can have 'n' number of rows. i tried to use heirarchical child template, but i am not able to add two different children which are binded to different itemsource. Kindly help me with this.

Thanks,
Somasekharan
Somasekharan
Top achievements
Rank 1
 answered on 12 Dec 2012
9 answers
223 views
Hi,

we use VS2008 and telerik 2012.2.912.35 and we have a RadWindow and we're trying to use the êrsistenceFramework mechanism without any success :(

In our RadWindow, we have a RadRibbonView with RadDocking control and in the RadDocking control we have 3 panes. One pane contain a RadGridView, one pane contain a RadRichText and the last pane contain multiple TextBox.

In the application menu of the RadRibbonView, we implement an to to persist the layout of the RadWindow. Actually, when we click on the persist button, when in Loaded event we restore the layout, the application menu of the RadRibbonView appear open, the RadRichText contain the text of the moment when we persisted and it's the samething for all the TextBox.

After many hours of experimentation, we gave up :( Can you provide us a small demo on how to exclude the RadRibbonView and all the date of each controls from the persisting process.

Thank's
Tina Stancheva
Telerik team
 answered on 12 Dec 2012
1 answer
195 views
Hello,

is it possible to define an ItemsSource for a RadContextMenu only for a particular Part of the ContextMenu?
My Target is to have Header and Footer Items, which are always shown up (fixed Items) and to have Contextual Items which are filled from Item behind.
I tried it with an ItemsControl. This works so far, but if I hover one Contextual Item, the full ItemsControl is highlighted. Also the Icon is indented. Please see the attached Screenshot.

How can I remove the wrong highlighting and the Icon Indentation?

Thank you for your help!

My existing Source Code is the following (see ItemsControl):
RadContextMenu.Resources>
        <DataTemplate x:Key="SubItemTemplate">
            <telerik:RadMenuItem Header="{Binding DisplayName}" IsEnabled="{Binding Enabled}">
                <telerik:RadMenuItem.Icon>
                    <Image Stretch="Fill" MinHeight="0" MinWidth="0" MaxWidth="16" MaxHeight="16" Width="Auto" Height="Auto" Source="{Binding Image}" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
        </DataTemplate>
    </telerik:RadContextMenu.Resources>
 
    <!-- Region Add -->
    <telerik:RadMenuItem Header="Add" ItemsSource="{Binding Path=PossibleSubItems}" FontWeight="Bold" ItemTemplate="{StaticResource SubItemTemplate}">
        <telerik:RadMenuItem.Icon>
            <Image Width="16" Height="16" Stretch="Fill" Source="/Images/add2_16.png" />
        </telerik:RadMenuItem.Icon>
    </telerik:RadMenuItem>
 
    <telerik:RadMenuItem IsSeparator="True" />
    <!-- End Region -->
 
    <!-- FOLLOWING PART SHOWS THE CONTEXTUAL SUB-ITEMS -->
    <ItemsControl ItemsSource="{Binding ContextMenuSubItems}" ItemTemplate="{StaticResource SubItemTemplate}" />
 
    <telerik:RadMenuItem IsSeparator="True" />
 
    <!-- Region Delete -->
    <telerik:RadMenuItem Header="Delete...">
        <telerik:RadMenuItem.Icon>
            <Image Source="/Images/delete2_16.png" />
        </telerik:RadMenuItem.Icon>
    </telerik:RadMenuItem>
    <!-- End Region -->
 
    <!-- Region Rename -->
    <telerik:RadMenuItem Header="Rename" />
    <!-- End Region -->
 
</telerik:RadContextMenu>
Rosen Vladimirov
Telerik team
 answered on 12 Dec 2012
4 answers
98 views
Hi,
with latest control I get this Error:
Function: InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 

Class: System.Reflection.RuntimeMethodInfo

Stacktrace: 
 bei System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   bei Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(ItemPropertyInfo itemProperty, Object item)
   bei Telerik.Windows.Controls.RadDataForm.PopulatePropertiesInitialValues(Object currentItem)
   bei Telerik.Windows.Controls.RadDataForm.OnCurrentItemChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   bei System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   bei System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.Activate(Object item)
   bei System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   bei System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Run(Object arg)
   bei MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
   bei System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   bei System.Windows.ContextLayoutManager.UpdateLayout()
   bei System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   bei System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   bei System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   bei System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   bei System.Windows.Interop.HwndTarget.OnResize()
   bei System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Ivan Ivanov
Telerik team
 answered on 12 Dec 2012
2 answers
281 views
Hello,

I would like my chart to consists of a LineSeries that does not have labels shown on every node. For this, I have bound the ItemsSource of the LineSeries to an ObservableCollection<MyCrazyLineNode>. MyCrazyLineNode has Properties for the Value, the Category and an additional Property "IsValueVisible".

I tried to accomblish this by setting "ShowLabels" to "False" and define my own labels in the PointTemplate.
My code looks similar to this:
<telerik:LineSeries ItemsSource="{Binding MyCrazyLineNodes}" ValueBinding="Value" CategoryBinding="Category" ShowLabels="False">
  <telerik:LineSeries.PointTemplate>
    <DataTemplate>
      <Grid>
        <Canvas Margin="0,10,0,0" Visibility="{Binding IsValueVisible, [Converter stuff...}">
          <TextBlock Text="{Binding Value}" />
        </Canvas>
        <Path Data="M4,0 L8,4 L4,8 L0,4 Z" Fill="Red" Width="8" Height="8" Stretch="Fill" />
      </Grid>
    </DataTemplate>
  </telerik:LineSeries.PointTemplate>
  <AxisStuffAndSoOn />
</telerik:LineSeries>

However, this does not work, because I cannot bind to the Property IsValueVisible.
How can I do what I want? I hope my problem is understandable. ;-)

Best Regards
Michael
Michael
Top achievements
Rank 2
 answered on 12 Dec 2012
1 answer
111 views
Hi,

I define in my App.xaml this Style to remove the Context Menu from all Panes.

<Style TargetType="{x:Type telerik:RadPane}">
        <Setter Property="ContextMenuTemplate"
                Value="{x:Null}" />
    </Style>

My Panes, which are define in other csprojects and will be loaded by unity still have a context menu.

Can anybody help me with this situation.
Georgi
Telerik team
 answered on 12 Dec 2012
1 answer
279 views
I am evaluating the Telerik controls to see if they will work better for my team than the current Infragistics controls we are using.  So I start writing a sample application that will demonstrate a resource monitor we planned on writing.  My problem is that the chart works for a couple seconds, then stops working, but if I resize the application, it starts working again for a few seconds, then stops.  Here is my Xaml:

<chart:RadCartesianChart Grid.Column="0" Grid.Row="0">
    <chart:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis FontFamily="Segoe UI" FontSize="12"/>
    </chart:RadCartesianChart.HorizontalAxis>
    <chart:RadCartesianChart.VerticalAxis>
        <chartView:LinearAxis Minimum="0" Maximum="100"/>
    </chart:RadCartesianChart.VerticalAxis>
    <chartView:BarSeries ItemsSource="{Binding LogicalProcessors}" CategoryBinding="DisplayName" ValueBinding="Value">
        <chartView:BarSeries.PointTemplate>
            <DataTemplate>
                <Rectangle Fill="Green"/>
            </DataTemplate>
        </chartView:BarSeries.PointTemplate>
    </chartView:BarSeries>
</chart:RadCartesianChart>

I am binding to an ObservableCollection that contains objects that implement INotifyPropertyChanged.  For my sanity I did this:

<ItemsControl Grid.Column="0" Grid.Row="1" ItemsSource="{Binding LogicalProcessors}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Value}"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

I can see the values updating, so I know my events are firing, the Chart just isn't updating.  If needed I can attach the entire project.  Any ideas?
Nikolay
Telerik team
 answered on 12 Dec 2012
2 answers
700 views
Hello,
I'm working on an app where users may switch a theme from within the supported telerik themes (metro, vista, office_black, etc...).
The theme is kept as a preference at user level and restored at login.

Now in order to remain consistent with the current theme in use, I want to avoid using any predifines fixed brushes and use the theme palette instead. So I'm facing 2 problems:

1) Retreiving the current application theme in use.
As I load themes using the documented method:

Application.Current.Resources.MergedDictionaries.Clear()
Dim res1 As ResourceDictionary = New ResourceDictionary()
 res1.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute)
Dim res2 As ResourceDictionary = New ResourceDictionary()
res2.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute)
Dim res3 As ResourceDictionary = New ResourceDictionary()
  res3.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml", UriKind.RelativeOrAbsolute)
...

       
Application.Current.Resources.MergedDictionaries.Add(res1)
Application.Current.Resources.MergedDictionaries.Add(res2)
Application.Current.Resources.MergedDictionaries.Add(res3)

In order to retreive the current theme I haven't found anything prettier than checking the current merged dictionnaries and extracting the theme name from there:

Dim str As String = My.Application.Current.Resources.MergedDictionaries(1).Source.OriginalString
str = Strings.Mid(str, 25, str.Length)
str = Left(str, str.IndexOf(";"))
'Returns the Theme's name in use


I can do that or just keep track of the current them when it's loaded.
But isn't there any more obvious way of accessing the current theme in use?

2) Using the current Theme pallete
Once I get the theme name, I could decide of an approriate color for the theme in use...
But, for a metro style i have found the following is possible:
Dim colorPalette = MetroColors.PaletteInstance
Dim converter As New System.Windows.Media.BrushConverter
Me.gridStatus.Background = DirectCast(converter.ConvertFromString(colorPalette.AccentColor.ToString), Brush)

I can alter my interface using the colorpalette maincolor, accentcolor, strongColor, etc... and remain consistent with the theme.
How do I get a color pallete's ref of the other themes (Expression_Dark, Vista, Summer, etc...) and achieve the same result.

Many thanks.

Kristoffer
Top achievements
Rank 1
 answered on 12 Dec 2012
3 answers
359 views
I can add a context menu to my tab items as shown below. However, I want all RadTabItems to have this menu - keeping their current theme (user is allowed to switch between themes). How can this be done without repeating this code for each tab item?

<telerik:RadTabControl x:Name="tabControl" Grid.Row="1" VerticalAlignment="Top"
                               DisplayMemberPath="Content" DropDownDisplayMode="Visible" ScrollMode="Viewport">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu>
                    <telerik:RadMenuItem Header="Do Stuff" />
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

Thanks!
Rosen Vladimirov
Telerik team
 answered on 12 Dec 2012
7 answers
626 views
The problem I am having is that I am creating a ContextMenu on the GridViewHeaderRow where I list the column header text with checkboxes so the user can select which ones to display.  When I assign the column.Header with text directly, obviously all I have to do is loop through and get column.Header; however when I don't assign the Header, and let the GridView figure the text by using the DisplayAttribute.ShortName of the bound data members, the column.Header is null.  I know the text must be somewhere, but I can't find it.

Is there some way to determine the ShortName from the GridViewColumn in this scenario?

Thanks in advance,
Steve
Steve
Top achievements
Rank 1
 answered on 11 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?