Exception at start application

2 posts, 0 answers
  1. Stefano
    Stefano avatar
    2 posts
    Member since:
    Mar 2015

    Posted 21 Mar 2015 Link to this post

    I've added a simply line of Databar control, but when I run the application, an exception id fired:

    https://www.dropbox.com/s/8ptw82rm7ui0wth/Screenshot%202015-03-21%2021.28.39.png?dl=0

    that the code of xaml:
    <Window x:Class="HierarchicalGroupingAndFilteringWithTreeView.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:HierarchicalGroupingAndFilteringWithTreeView"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
            Title="MainWindow" WindowState="Maximized">
        <Window.DataContext>
            <local:ViewModel />
        </Window.DataContext>
        <Window.Resources>
            <Style TargetType="telerik:RadTreeViewItem">
                <Setter Property="IsExpanded" Value="True" />
                <Setter Property="Margin" Value="0 2 0 2" />
            </Style>
            <DataTemplate x:Key="Team">
                <Grid>

                    <TextBlock Text="{Binding Name}" />
                </Grid>
            </DataTemplate>
            <HierarchicalDataTemplate x:Key="Division" ItemTemplate="{StaticResource Team}" ItemsSource="{Binding Teams}">
                <TextBlock Text="{Binding Name}" />
            </HierarchicalDataTemplate>
            <telerik:GroupHeaderTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
                <telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
                    <DataTemplate>
                        <ContentPresenter Content="{Binding FormattedName}" Height="16" Margin="4"/>
                    </DataTemplate>
                </telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
                <telerik:GroupHeaderTemplateSelector.VerticalTemplate>
                    <DataTemplate>
                        <ContentPresenter Content="" Height="16" VerticalAlignment="Top" />
                    </DataTemplate>
                </telerik:GroupHeaderTemplateSelector.VerticalTemplate>
            </telerik:GroupHeaderTemplateSelector>
        </Window.Resources>

        <Grid>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <telerik:RadDataBar Width="200" Height="30" VerticalAlignment="Top"></telerik:RadDataBar>

            <telerik:RadTreeView Grid.Row="1" ItemsSource="{Binding TreeViewItems}" ItemTemplate="{StaticResource Division}" Margin="-5,78,5,22">
                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding EventName="Expanded" Command="{Binding ExpandedCommand}" PassEventArgsToCommand="True" />
                    <telerik:EventBinding EventName="Collapsed" Command="{Binding CollapsedCommand}"  PassEventArgsToCommand="True"/>
                </telerik:EventToCommandBehavior.EventBindings>
            </telerik:RadTreeView>
            <telerik:RadScheduleView Grid.Column="1" Grid.Row="1" 
                                     AppointmentsSource="{Binding Appointments}" 
                                     ResourceTypesSource="{Binding ResourceTypes}"
                                     GroupHeaderContentTemplateSelector="{StaticResource CustomGroupHeaderContentTemplateSelector}">
                <telerik:RadScheduleView.ViewDefinitions>
                    <telerik:TimelineViewDefinition GroupFilter="{Binding GroupFilter}"
                                                    MinorTickLength="30min" MajorTickLength="30min"  DayStartTime="7:30:00" DayEndTime="17:30:00" VisibleDays="1"  SmallChangeInterval="3d"/>
                    <telerik:DayViewDefinition MinorTickLength="30min" MajorTickLength="30min"/>

                </telerik:RadScheduleView.ViewDefinitions>
                <telerik:RadScheduleView.GroupDescriptionsSource>
                    <telerik:GroupDescriptionCollection>
                        <telerik:ResourceGroupDescription ResourceType="Common" />
                    </telerik:GroupDescriptionCollection>
                </telerik:RadScheduleView.GroupDescriptionsSource>
                <telerik:RadScheduleView.DragDropBehavior>
                    <local:ConflictCheckingDragDropBehavior  />
                </telerik:RadScheduleView.DragDropBehavior>
            </telerik:RadScheduleView>
        </Grid>

    </Window>


  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Mar 2015 Link to this post

    Hello Stefano,

    Thank you for the attached xaml. Unfortunately, I was unable to reproduce the exception that you described. I created a small project based on the code you provided and I had to comment out somethings, because I do not have the code behind. I am left with a pretty simple xaml, where one data bar is used and when I run the project - everything is rendered properly and no exception is thrown.

    Could you please modify the project to reproduce the faulty behavior and send it back to us for investigation? Can you also specify the exact version you are using and whether it is the no-xaml variant. Thank you!

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top