Telerik Forums
UI for WPF Forum
4 answers
134 views
Hello everyone,

I recently started using the RadScheduleView component. I started with the example provided by Telerik "TimeBar Minimap for ScheduleView". The RadScheduleView be used to display the interventions of our technicans. Our technicians have office hours (usually) between 7am to 20pm. 
Our desire is to not display these hours to provide a better display of working hours. For this, we informed the DayStartTime and DayEndTime properties in TimelineViewDefintion.

<telerik:TimelineViewDefinition
    ShowTimeRuler="True"
    TimerulerGroupStringFormat="{}{0:dddd, dd/MM/yyyy}"
    TimerulerMajorTickStringFormat="{}{0:%H}"
    TimerulerMinorTickStringFormat=":{0:%m}"
    VisibleDays="{Binding ElementName=TimeBar, Path=Selection, Converter={StaticResource VisibleDaysConverter}}"
    StretchAppointments="True"
    StretchGroupHeaders="True"
    DayStartTime="07:00"
    DayEndTime="20:00"
    MajorTickLength="1h"
    MinorTickLength="15min"
    MinTimeRulerExtent="50"
    MaxTimeRulerExtent="Infinity"
    FirstDayOfWeek="Monday" />

This works well if we show one day as in the example (OneDay.png). O
n the timeline each MinorTick is 15 minutes.

By cons, if we show two consecutive days, the first day starts at 7am, the second day ends at 20pm but between the two days, all hours (even those outside of the desired range) are displayed. See TwoDays.png.

I marked in red on the image TwoDays.png parts that we do not want to see.

How do that the DayStartTime and DayEndTime properties will be used for every day when displaying several days?

Thank you for your help and sorry if my English is not great.
Kalin
Telerik team
 answered on 26 Jun 2014
1 answer
123 views
Hello,
I have a GridView with one column with width "*", and the rest "Auto", which allows for the user resizing the window.

I am hiding the Group Indent Cell using this:

<Style TargetType="telerik:GridViewIndentCell">
    <Setter Property="Visibility" Value="Collapsed"/>
</Style>

but this seems to still affect the width of the resulting row since I end up with a gap at the end of the row which I can't use and can't click. It appears to me that the row is sized before the GridViewIndentCell is hidden, and the row is not resized again to allow for the extra width. (See attached screenshot).

1. Is there a way of removing this gap?
2. I would also like to turn off the border round the currently selected cell and can't find a way to do this.

Any help would be appreciated.

Thanks,
John
Dimitrina
Telerik team
 answered on 26 Jun 2014
1 answer
181 views
Hi!

This has probably something to do with the style that my RadTabItems are using but I thought it would be faster for me to solve this by asking here.
What my problem is that adding of RadTabItems to my TabControl works until the tabs reach the right side of the application window. After that something weird is happening and no wrapping or anything is done, I only see some of the tabs and they are "scaled" to fill the visible part of the tabitem area.

I have tried changing the settings of TabControl:
- ScrollMode="Pixel", "Item", "Viewport"
- OverflowMode="Scroll", "Wrap"
- DropDownDisplayMode="Visible", "WhenNeeded"

but none of these seem to do anything in this case. I would like my tabcontrol to have scroll buttons if tab items overflow.

Maybe it has something to do with some Width or Height property?

Here's couple of screenshots before adding the last tab item and after adding it:

TabControl before adding last item
TabControl after adding last item

Here's the XAML for my TabControl:
<telerik:RadTabControl
        Width="Auto"
        Height="Auto"
        x:Name="TabRegion"
        Prism:RegionManager.RegionName="{x:Static inf:RegionNames.TabRegion}"
        AllowDragReorder="True"
        SelectedItemRemoveBehaviour="SelectPrevious"
        ItemContainerStyle="{DynamicResource RadTabItemStyle1}"
        ScrollMode="Viewport"
        OverflowMode="Scroll"
        DropDownDisplayMode="WhenNeeded"
        SelectedIndex="{Binding SelectedDashboardTab, Mode=TwoWay}"/>

And here's RadTabItemStyle1:

<Style x:Key="RadTabItemStyle1" TargetType="{x:Type telerik:RadTabItem}">
    <Setter Property="MinWidth" Value="50"/>
    <!-- Setter Property="BorderThickness" Value="{StaticResource TabItem_OuterBorderThickness}"/ -->
    <Setter Property="Foreground" Value="White"/>
    <Setter Property="MinHeight" Value="30"/>
    <Setter Property="Background">
        <Setter.Value>
            <SolidColorBrush Color="#FF00659E"/>
        </Setter.Value>
    </Setter>
    <!-- Setter Property="BorderBrush" Value="{StaticResource TabItem_OuterBorder_Normal}"/ -->
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="10 0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Header" Value="{Binding DataContext.ViewTitle, UpdateSourceTrigger=PropertyChanged}"/>
    <Setter Property="Height" Value="30" />
    <Setter Property="IsSelected" Value="{Binding DataContext.IsTabSelected, Mode=TwoWay}"/>
    <!-- Setter Property="DropDownContent" Value="{Binding DataContext.ViewTitle, UpdateSourceTrigger=PropertyChanged}"/ -->
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <ContentControl Content="{Binding}" />
                    <telerik:RadButton Grid.Column="1"
                            Width="14"
                            Height="14"
                            Margin="5 0 0 0"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            FontSize="10"
                            Foreground="Black"
                            Background="White"
                            l:RoutedEventHelper.EnableRoutedClick="True"
                            Padding="0"
                            Focusable="False"
                            >
                        <Image Source="/Dashboard;component/Images/delete_icon.png" Width="10" Height="10" Focusable="False"/>
                    </telerik:RadButton>
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Template" Value="{DynamicResource RadTabItemControlTemplate2}"/>
</Style>


And the ControlTemplate it is using:

<ControlTemplate x:Key="RadTabItemControlTemplate2" TargetType="{x:Type telerik:RadTabItem}">
        <Grid x:Name="wrapper">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStateGroup">
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectionVisual"/>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="SelectedMouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectionVisual"/>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="SelectionVisual">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="#FFFFC92B"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.1" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HeaderElement"/>
                            <DoubleAnimation Duration="0:0:0.1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NormalVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="PlacementStates">
                    <VisualState x:Name="HorizontalTop"/>
                    <VisualState x:Name="HorizontalLeft">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="180"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="HorizontalRight"/>
                    <VisualState x:Name="HorizontalBottom">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="180"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="VerticalTop">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="-90"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="VerticalLeft">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="90"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="VerticalRight">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="-90"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="VerticalBottom">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="OrientationTransform">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <RotateTransform Angle="-90"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValidationStates"/>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="NormalVisual" CornerRadius="0" Margin="0,2,0,0" Background="Black" BorderBrush="#05C33F3F" Height="28">
                <Border BorderBrush="#FF002564" BorderThickness="1,1,1,0" CornerRadius="0" Background="#FF004D78"/>
            </Border>
            <Border x:Name="MouseOverVisual" BorderBrush="Black" BorderThickness="1,1,1,0" CornerRadius="0" Margin="0,2,0,0" Opacity="0" Background="#FF5FC2FA">
                <Border BorderThickness="1,1,1,0" CornerRadius="0" BorderBrush="#00000000"/>
            </Border>
            <Border x:Name="SelectionVisual" BorderBrush="#00000000" BorderThickness="1,1,1,0" CornerRadius="0" Margin="0" Opacity="0" Background="Black">
                <Border BorderBrush="Blue" BorderThickness="0,0,0,0" CornerRadius="0" Background="#FF0479BA"/>
            </Border>
            <telerik:LayoutTransformControl x:Name="OrientationTransform" IsTabStop="False">
                <ContentPresenter x:Name="HeaderElement" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </telerik:LayoutTransformControl>
        </Grid>
    </ControlTemplate>

Br,

Kalle
Kiril Vandov
Telerik team
 answered on 26 Jun 2014
5 answers
208 views
I have a problem where using a multi-binding to format axis labels correctly updates the labels, but does not resize correctly when the size of the labels change.

You can see the problem with this small example:
<Window x:Class="LabelTemplate_MultiBinding.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"
                xmlns:local="clr-namespace:LabelTemplate_MultiBinding"
                Title="MainWindow" Height="768" Width="1024">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <telerik:RadCartesianChart x:Name="PropertyChart">
            <telerik:RadCartesianChart.Resources>
                <local:ChartNumberFormatter x:Key="NumberFormatter"/>
                <DataTemplate x:Key="FormattedNumericAxisTemplate">
                    <TextBlock>
                        <TextBlock.Text>
                            <MultiBinding Converter="{StaticResource NumberFormatter}">
                                <Binding />
                                <Binding ElementName="PropertyChart"
                                         Path="DataContext.NumericFormat"/>
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </DataTemplate>
            </telerik:RadCartesianChart.Resources>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis LabelTemplate="{StaticResource FormattedNumericAxisTemplate}" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:LineSeries
                       CategoryBinding="Date"
                       ValueBinding="Value"
                       ItemsSource="{Binding Path=Series1}">
                </telerik:LineSeries>
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Label>Y Axis Format:</Label>
            <TextBox Text="{Binding NumericFormat}" Width="200" />
        </StackPanel>
    </Grid>
</Window>

Code Behind:
public class MyPoint
{
    public DateTime Date { get; set; }
    public Double Value { get; set; }
}
public partial class MainWindow : Window, INotifyPropertyChanged
{
    public List<MyPoint> Series1 { get; private set; }
 
    private string _NumericFormat;
    public string NumericFormat
    {
        get { return _NumericFormat; }
        set
        {
            if (_NumericFormat != value)
            {
                _NumericFormat = value;
                OnPropertyChanged("NumericFormat");
            }
        }
    }
 
    public MainWindow()
    {
        Series1 = new List<MyPoint>();
        for (int i = 0; i < 5; i++)
        {
            DateTime date = DateTime.Today.AddDays(i);
            Series1.Add(new MyPoint() { Date = date, Value = i * 1000 });
        }
        InitializeComponent();
        DataContext = this;
    }
 
    #region INotifyPropertyChanged
    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual void OnPropertyChanged(string propertyName = "")
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    #endregion
}
public class ChartNumberFormatter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        double number = System.Convert.ToDouble(values[0]);
        string format = values[1] as string;
        if (string.IsNullOrEmpty(format))
        {
            return number.ToString();
        }
        return number.ToString(format);
    }
    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

If you run this example, and in the Y-axis format box enter "e" then press tab to activate, you can see the numbers correctly change to scientific notation, but now they overlap the chart!

Can you recommend something to trigger the axis to be redrawn correctly?

Thanks,
Louis
Martin Ivanov
Telerik team
 answered on 26 Jun 2014
1 answer
220 views
Hi,
In my application, I open a modal window in a separate thread with following method:

public static void ShowInSeparateThread(Type windContent, string windowTitle, int width = 900, int height = 700)
        {
            var _viewerThread = new Thread(delegate()
            {
                var _eventAggregg = ServiceLocator.Current.GetInstance<IEventAggregator>();
 
                _eventAggregg.GetEvent<ShowModalPopUp>().Publish(true);
 
                var _win = new Window
                {
                    Title = windowTitle,
                    DataContext = new WindowDataContext(),
                    WindowStartupLocation = WindowStartupLocation.CenterScreen,
                    WindowStyle = WindowStyle.None,
                    Style = Application.Current.FindResource("PopUpWindowStyle") as Style,
                    Padding = new Thickness(0),
                    Margin = new Thickness(0),
                    ResizeMode = ResizeMode.NoResize,
                    Content = ServiceLocator.Current.GetInstance(windContent),
                    Width = width,
                    Height = height,
                    ShowInTaskbar = false
                };
 
               typeof(Window)
                    .InvokeMember("_ownerHandle",
                        BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField,
                        null, _win, new object[] { Process.GetCurrentProcess().MainWindowHandle });
 
                _win.ShowDialog();
                _eventAggregg.GetEvent<ShowModalPopUp>().Publish(false);
            })
            {               
                IsBackground = true
            };
            _viewerThread.SetApartmentState(ApartmentState.STA);
            _viewerThread.Start();
        }
    }



In this window i navigate some user controls. One of that user controls contains a RadGridView binded to an ObservableCollection. When I add an item to ObservableCollection the grid items are properly notified, but when I try to remove an item from ObservableCollection i receive

The calling thread cannot access this object because a different thread owns it.

If try to change the RadGridView with native DataGrid and all works correctly. I tried also with Dispatcher.Invoke but this approach not solve my problem.

Thanks in advance for Help.
Nick
Telerik team
 answered on 26 Jun 2014
7 answers
63 views
We have two TreeListViews that we display one above the other (with some other UI bits in the middle).  We desire to have the widths of the columns in these two tree views match.  We do use footers in the columns, and the footer widths would need to be taken into account.  Something like SharedSizeDefinition as used on Grid ColumnDefinition and RowDefinition would be ideal, if possible.  How can we do this, please?


example (not intended to build; cut down from the real application code):

<telerik:RadTreeListView ItemsSource="{Binding Path=MyFirstList}"  >
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding ChildVMs}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
 
    <telerik:RadTreeListView.Columns>
 
        <telerik:GridViewDataColumn Header="Name" UniqueName="Name" IsSortable="True" SortingState="Ascending"
                                IsReadOnly="True"  DataMemberBinding="{Binding Name}" />
 
        <telerik:GridViewDataColumn Header="Value" TextAlignment="Right"
                                DataMemberBinding="{Binding CurrentValue, Mode=TwoWay}" >
            <telerik:GridViewDataColumn.Footer>
                <TextBlock FontSize="12" VerticalAlignment="Top" HorizontalAlignment="Right"
                    Text="{Binding  Path=SomeOtherNumber, Mode=OneWay}" />
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
                     
        <telerik:GridViewDataColumn Header="Timeline" Width="*" IsReadOnly="True"
                            CellTemplateSelector="{StaticResource TimelineTemplateSelector}"
                            CellStyle="{StaticResource TimelineCellStyle}"
                            FooterCellStyle="{StaticResource TimelineFooterStyle}" >
            <telerik:GridViewDataColumn.Footer>
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
 
                    <telerik:RadHorizontalDataAxis  Stroke="DarkRed" Foreground="Gray" ...  />
 
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
 
<!-- some other content -->
 
<telerik:RadTreeListView ItemsSource="{Binding Path=MySecondList}"  >
    <!-- similar to the first list -->
</telerik:RadTreeListView>


David
Top achievements
Rank 1
Iron
Iron
 answered on 26 Jun 2014
4 answers
1.5K+ views
Hello,

I have tried binding a TextBlock in a DataTemplate to a member in the ViewModel to change it's visibility but it is not working.  This is for a custom control that contains a RadCarousel where it's ItemTemplate property is set to a StaticResource in the control, the DataTemplate.

Can someone offer a suggestion for the easiest way to change the visibility of a control in a DataTemplate?

Thanks,
Reid
Reid
Top achievements
Rank 2
 answered on 25 Jun 2014
9 answers
287 views
We are using the RadTreeView extensively in our product and building the nodes through binding (our application follows the MVVM pattern)? I don't know if that last detail matters but when we handed off an alpha release to our QA department, they are reporting that the AutomationId property is blank when using the Microsoft Coded UI Test Builder. Is this something we need code for or is it something the Telerik control should be providing out of the box? 
Claudio
Top achievements
Rank 1
 answered on 25 Jun 2014
4 answers
78 views
Hi,

I have created a database for the RadScheduleView following Telerik
tutorials. I am able to create the database, save appointments with their
categories, time markers etc.

When I load the app, I have few appointments displayed
correctly, I can double click to edit them, I can drag them around, and expand
or shrink them. However there is one problem, if I load the app and the first
thing I do is try to expand or shrink an appointment I get this:

 

System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=Object
reference not set to an instance of an object.
Source=Telerik.Windows.Controls.ScheduleView
  StackTrace:
       at
Telerik.Windows.Controls.ScheduleViewBase.<>c__DisplayClass23.<GetDecorationBlocksForSlot>b__1f(IGroupItemInfo
info)
       at
System.Linq.Enumerable.WhereListIterator`1.MoveNext()
       at
System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
       at
System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
       at
Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source,
Action`1 action)
       at
Telerik.Windows.Controls.HighlightPanel.MeasureOverride(Size availableSize)
       at
System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at
System.Windows.UIElement.Measure(Size availableSize)
       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.RenderMessageHandler(Object resizedCompositionTarget)
       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.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at
System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       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, Int32 numArgs)
       at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, 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.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       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.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
       at
System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject,IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
       at
System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObjectdataObject, DragDropEffects allowedEffects)
       at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
       at
Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects, DragDropKeyStates
initialKeyState, Object dragVisual, Point relativeStartPoint, Point dragVisualOffset)
       at
Telerik.Windows.DragDrop.DragInitializer.StartDrag()
       at
Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
       at Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(Object
sender, MouseEventArgs e)
       at
System.Windows.Input.MouseEventArgs.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.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at
System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at
System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs
args)
       at
System.Windows.UIElement.RaiseTrustedEvent(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, 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.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, 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.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       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.TranslateAndDispatchMessage(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
ScheduleViewTest.App.Main() in c:\Apps\TelerikDatabase\TelerikScheduleViewDatabase\ScheduleViewTest\obj\x86\Debug\App.g.cs:line
0
       at System.AppDomain._nExecuteAssembly(RuntimeAssemblyassembly, String[] args)
       at
System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback, Object state)
       at
System.Threading.ThreadHelper.ThreadStart()
  InnerException:

This only happens if I try to extend or shrink First, if I drag
and drop and then try to extend or shrink then its working properly, what
settings are need to make it work properly?

Kind Regards

Yana
Telerik team
 answered on 25 Jun 2014
4 answers
354 views
Hi all,

I'm having an issue where I can't get an object to bind to my backstage view. I've used the code from the website to try and implement a recent file list from a class within another project.

A cut-down version of my BackstageViewModel to demonstrate what I'm calling:
public class BackstageViewModel : IViewModel {
 
    public RecentFileList RecentFiles { get; set; } // the property I want to point to
 
    public BackstageViewModel(ApplicationCommandProxy commandProxy, DataHolder data)
    {
        //random setup stuff
    }
 
    //and so on...
}

The RecentFileList class is a class from the WpfApplicationFramework library. You can obtain the library here. In summary, it's a holder class for a ReadOnlyObservableCollection of RecentFile called RecentFiles.

This is the portion of the code where I'm creating my items control in my backstage where ssm points to the project namespace.
<ItemsControl Name="RecentItem" DataContext="{Binding ssm:BackstageViewModel}" ItemsSource="{Binding RecentFiles.RecentFiles}" Focusable="True" DisplayMemberPath="RecentFiles">
         <ItemsControl.Template>
                    <ControlTemplate>
                           <telerik:RadRibbonButton Width="285" Command="{x:Static commands:ApplicationCommands.RecentDocumentCommand}">
                                    <StackPanel Orientation="Horizontal">
                                            <Image Source="Resources/Open_16.png" />
                                            <StackPanel Margin="3 0 0 0" HorizontalAlignment="Left">
                                                   <TextBlock Margin="0 0 0 2" Text="Example Study" />
                                                   <TextBlock Foreground="DimGray" Text="{Binding Path}" />
                                            </StackPanel>
                                     </StackPanel>
                            </telerik:RadRibbonButton>
                    </ControlTemplate>
          </ItemsControl.Template>
</ItemsControl>

All I need to do is have the ItemsControl populate using the ReadOnlyObservableCollection<RecentFile> from within the RecentFileList object. I'm struggling to get it to bind correctly so any help would be greatly appreciated!
Lance | Senior Manager Technical Support
Telerik team
 answered on 25 Jun 2014
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?