This is a migrated thread and some comments may be shown as answers.

[Solved] Blend 4 Exception with telerik:CountFunction Caption="Count:"

2 Answers 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
natraj
Top achievements
Rank 1
natraj asked on 16 Aug 2011, 10:37 PM
The below line is breaking DesignTime support in Blend with the below exceptions..please help
<telerik:CountFunction Caption="Count:" />
error 1: The specified value cannot be assigned to the collection. The following type was expected: "AggregateFunction".
error 2: The local property "Caption" can only be applied to types that are derived from "AggregateFunction".

In VS2010 it work fine in Design/Xaml View.

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
    xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:local="clr-namespace:ResourcesLibrary.Behaviors;assembly=ResourcesLibrary"
    xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
  ....
    mc:Ignorable="d"
    d:DesignWidth="1000">

   .

    <Border CornerRadius="3,3,6,6" BorderThickness="1" Background="#FFDDE1EA" Margin="0"  BorderBrush="DimGray">
        <toolkit:BusyIndicator IsBusy="{Binding IsBusy}">

            <Grid x:Name="LayoutRoot" VerticalAlignment="Stretch" Margin="3" DataContext="{Binding}" >
                <Border CornerRadius="12" BorderThickness="2" >

                    <Grid DataContext="{Binding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="251.75*"/>
                            <RowDefinition Height="35"/>
                        </Grid.RowDefinitions>
                        <Border >

                        </Border>
                       


                        <telerik:RadDataPager x:Name="DataGridPager" PageSize="100" DisplayMode="All" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Source="{Binding PSLEmailNotificationList}" BorderBrush="#FF7DBAFF">
                            <telerik:RadDataPager.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFCEE6FE"/>
                                    <GradientStop Color="#FFADCBEF" Offset="0.5"/>
                                </LinearGradientBrush>
                            </telerik:RadDataPager.Background>
                        </telerik:RadDataPager>
                        <telerik:RadGridView x:Name="Items" IsReadOnly="True" CanUserReorderColumns="False" CanUserResizeColumns="False" AutoGenerateColumns="False"  
                        Grid.Row="0" IsBusy="{Binding IsBusy,Mode=TwoWay}" Grid.RowSpan="1" RowIndicatorVisibility="Collapsed"
                         IsFilteringAllowed="True" MaxHeight="400" MinHeight="40" telerik:StyleManager.Theme="Office_Blue"
                         ItemsSource="{Binding PagedSource,ElementName=DataGridPager,Mode=TwoWay}" >
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn Header=" Active" Width="50" TextAlignment="Center" IsFilterable="True">
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox x:Name="ActiveCB" IsChecked="{Binding PSLNotificationFlag, Mode=TwoWay}" VerticalAlignment="Center"  HorizontalAlignment="Center"
                                                      cal:Message.Attach="[Event Click] = [Action HandleIsDirty($datacontext,$eventArgs)]"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn  Header="  Facility" Width="280" ToolTipTemplate="{StaticResource FacilityNameToolTip}"
                                                             DataMemberBinding="{Binding FacilityName, Converter={StaticResource TextTrimByCharacter},ConverterParameter=39}">
                                    <telerik:GridViewDataColumn.AggregateFunctions>
   <telerik:CountFunction Caption="Count:" />

                                    </telerik:GridViewDataColumn.AggregateFunctions>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header="Contact" DataMemberBinding="{Binding ContactFullName}"   Width="100" />
                                <telerik:GridViewDataColumn Header="Phone"  DataMemberBinding="{Binding Phone, Converter={StaticResource PhoneNumberConvert}}"  Width="100" />
                                <telerik:GridViewDataColumn  Header="  Email" Width="200" ToolTipTemplate="{StaticResource EmailToolTip}"
                                                             DataMemberBinding="{Binding Email}"  />
                                <telerik:GridViewDataColumn Header=" S" Width="30" TextAlignment="Center" IsFilterable="True">
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox  IsChecked="{Binding SubFlag, Mode=TwoWay}" VerticalAlignment="Center"  HorizontalAlignment="Left"
                                                       cal:Message.Attach="[Event Click] = [Action HandleIsDirty($datacontext,$eventArgs)]"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header=" L" Width="30" TextAlignment="Center" IsFilterable="True">
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox IsChecked="{Binding LogFlag, Mode=TwoWay}" VerticalAlignment="Center"  HorizontalAlignment="Left"
                                                      cal:Message.Attach="[Event Click] = [Action HandleIsDirty($datacontext,$eventArgs)]"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header=" H" Width="30" TextAlignment="Center" IsFilterable="True">
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox  IsChecked="{Binding HoldFlag, Mode=TwoWay}" VerticalAlignment="Center"  HorizontalAlignment="Left"
                                                       cal:Message.Attach="[Event Click] = [Action HandleIsDirty($datacontext,$eventArgs)]"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                </telerik:GridViewDataColumn>
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>







                        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" VerticalAlignment="Top"  Grid.Row="2" Margin="0,2,10,0" d:LayoutOverrides="GridBox">
                            <Button x:Name="OnAddCommand" Content="Add New" FontWeight="Bold" Height="32" Style="{StaticResource BlueGradientButtonStyle}" Width="101" Margin="15,0" HorizontalAlignment="Right"/>
                            <Button x:Name="OnSaveCommand" Content="Save" IsEnabled="{Binding CanSave, Mode=TwoWay}" FontWeight="Bold" Height="32" Foreground="#FF3F4141"  Style="{StaticResource BlueGradientButtonStyle}"  Width="70"/>


                        </StackPanel>
                    </Grid>
                </Border>
            </Grid>
        </toolkit:BusyIndicator>
    </Border>
</UserControl>

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 17 Aug 2011, 12:06 PM
Hi Natraj,

 

Most probably this is a problem related to the Microsoft Expression Blend environment.
Furthermore you should keep in mind that when you are working on a project in VS and open it Blend, the assembly references are not updated automatically.  They might be out of date, which could be preventing the designer from working correctly. You may add them manually in Blend and then rebuild the project. Then everything should work correctly. Please give it a try and let me know how it goes. In addition to this you may always submit a support ticket and attach your application where we can see that might be wrong.


I look forward to hearing from you!


Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
natraj
Top achievements
Rank 1
answered on 17 Aug 2011, 04:35 PM
Adding the references from Blend and closing and reopening the project fixed the issue.

Thanks.
Tags
GridView
Asked by
natraj
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
natraj
Top achievements
Rank 1
Share this question
or