Upgrade 2011.2.920.1040 dll to 2011.3.1309.1040 dll Breaks my Inline edit and row details update.

5 posts, 0 answers
  1. Don
    Don avatar
    6 posts
    Member since:
    Sep 2007

    Posted 18 Jan 2012 Link to this post

    I recently updated my dlls for a project containing the RadGridVIew.
    The old Dll was -> 2011.2.920.1040
    The new Dll is -> 2011.3.1309.1040 (Q3 2011 SP1)

    The RadGridView I am using has its ItemsSource Bound to an Observable Collection of Custom Objects
    The Binding is still working in that the grid is populated correctly and all data is showing as expected.

    The issue is that now when inline editing my row details are not updating as I tab through the row cells.
    This was working so as I edited a cell the details would show that change on the leaving of the cell where I am updating my object.
    The data is saved correctly it is just not reflected in the row details display, as well when I select another row the first column change is reverted to the old data.
    Also within the cellEditEnded event the object sometimes is missing its primary Guid so my logic then creates a new item and does not update the current object.

    I can edit the first cell and then go to another cell, the new data is there until I select another row then the old data for the first cell appears again, If I reload the whole grid the new change is shown. All other cell changes are working.

    I will attach the Xaml and cs files for the grid. The ItemsSource is set on another page.
    I DO NOT want to have to refresh the entire grid after a single cell edit change, and hope this behaviour can be fixed so it works as it did with the old dll.

    <UserControl x:Class="GroupCalendar2012.Views.CalendarGrid"
        xmlns:converters="clr-namespace:GroupCalendar2012.Converters"
        xmlns:class="clr-namespace:GroupCalendar2012.Classes"
        xmlns:views="clr-namespace:GroupCalendar2012.Views"
        mc:Ignorable="d"
        d:DesignHeight="400" d:DesignWidth="800">
      
        <UserControl.Resources>
      
            <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
            <converters:ToolTipFormatConverter x:Key="ToolTipFormatConverter" x:Name="ToolTipFormatConverter"  />
      
            <converters:AppointmentRegardingDisplayConverter x:Key="AppointmentRegardingDisplayConverter" x:Name="AppointmentRegardingDisplayConverter" />
            <converters:AppointmentRegardingVisibilityConverter x:Key="AppointmentRegardingVisibilityConverter" x:Name="AppointmentRegardingVisibilityConverter" />
      
            <converters:AppointmentRequiredAttendeesListDisplayConverter x:Key="AppointmentRequiredAttendeesListDisplayConverter" x:Name="AppointmentRequiredAttendeesListDisplayConverter" />
            <converters:AppointmentRequiredAttendeesVisibilityConverter x:Key="AppointmentRequiredAttendeesVisibilityConverter" x:Name="AppointmentRequiredAttendeesVisibilityConverter" />
              
            <!--
            <converters:AppointmentOrganizerColorConverter x:Key="AppointmentOrganizerColorConverter" x:Name="AppointmentOrganizerColorConverter" />
      
            <converters:AppointmentTypeFormatConverter x:Key="AppointmentTypeFormatConverter" x:Name="AppointmentTypeFormatConverter"  />
            <converters:AppointmentTypeDisplayConverter x:Key="AppointmentTypeDisplayConverter" x:Name="AppointmentTypeDisplayConverter"  />
            <converters:AppointmentTypeColorConverter x:Key="AppointmentTypeColorConverter" x:Name="AppointmentTypeColorConverter" />
            <converters:AppointmentTypeTextColorConverter x:Key="AppointmentTypeTextColorConverter" x:Name="AppointmentTypeTextColorConverter" />
            <converters:AppointmentTypeVisibilityConverter x:Key="AppointmentTypeVisibilityConverter" x:Name="AppointmentTypeVisibilityConverter" />
      
            <converters:AppointmentDivisionFormatConverter x:Key="AppointmentDivisionFormatConverter" x:Name="AppointmentDivisionFormatConverter" />
            <converters:AppointmentDivisionDisplayConverter x:Key="AppointmentDivisionDisplayConverter" x:Name="AppointmentDivisionDisplayConverter" />
            <converters:AppointmentDivisionColorConverter x:Key="AppointmentDivisionColorConverter" x:Name="AppointmentDivisionColorConverter" />
            <converters:AppointmentDivisionTextColorConverter x:Key="AppointmentDivisionTextColorConverter" x:Name="AppointmentDivisionTextColorConverter" />
            <converters:AppointmentDivisionVisibilityConverter x:Key="AppointmentDivisionVisibilityConverter" x:Name="AppointmentDivisionVisibilityConverter" />
      
             
      
            <converters:AppointmentLocationDisplayConverter x:Key="AppointmentLocationDisplayConverter" x:Name="AppointmentLocaitonDisplayConverter" />
            <converters:AppointmentLocationVisibilityConverter x:Key="AppointmentLocationVisibilityConverter" x:Name="AppointmentLocationVisibilityConverter" />
      
            <converters:AppointmentTimeFrameDisplayConverter x:Key="AppointmentTimeFrameDisplayConverter" x:Name="AppointmentTimeFrameDisplayConverter" />
            <converters:ForegroundTextColorConverter x:Key="ForegroundTextColorConverter" x:Name="ForegroundTextColorConverter" />
            <converters:DescriptionDisplayConverter x:Key="DescriptionDisplayConverter" x:Name="DescriptionDisplayConverter" />
            <converters:CompletedAppointmentImageDisplayConverter x:Key="CompletedAppointmentImageDisplayConverter" x:Name="CompletedAppointmentImageDisplayConverter" />
              
            -->
              
            <class:CellBackgroundStyleSelector x:Key="CellBackgroundStyleSelector">
                <class:CellBackgroundStyleSelector.CompletedAppointmentStyle>
                    <Style TargetType="telerik:GridViewCell">
                        <Setter Property="Background" Value="Gray" />
                        <Setter Property="IsEnabled" Value="False" />
                    </Style>
                </class:CellBackgroundStyleSelector.CompletedAppointmentStyle>
                <class:CellBackgroundStyleSelector.RecurringAppointmentStyle>
                    <Style TargetType="telerik:GridViewCell">
                        <Setter Property="Background" Value="Gray" />
                        <Setter Property="IsEnabled" Value="False" />
                    </Style>
                </class:CellBackgroundStyleSelector.RecurringAppointmentStyle>
                <class:CellBackgroundStyleSelector.NormalAppointmentStyle>
                    <Style TargetType="telerik:GridViewCell">
                    </Style>
                </class:CellBackgroundStyleSelector.NormalAppointmentStyle>
                <class:CellBackgroundStyleSelector.StateCodeNameStyle>
                    <Style TargetType="telerik:GridViewCell">
                        <Setter Property="Background" Value="Gray" />
                        <Setter Property="IsEnabled" Value="False" />
                    </Style>
                </class:CellBackgroundStyleSelector.StateCodeNameStyle>
            </class:CellBackgroundStyleSelector>
      
            <DataTemplate x:Name="RowDetailsTemplate">
                <Grid Background="{Binding ParetoOrganizer.UserBrush}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="15" />
                        <ColumnDefinition Width="15" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
      
                    <!-- Row 0 -->
                    <TextBlock x:Name="MainSubjectLabel" Text="Subject: " Grid.Row="0" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="MainSubjectText" Text="{Binding ParetoSubject}" 
                               TextWrapping="NoWrap" TextAlignment="Left" TextTrimming="WordEllipsis" Grid.Row="0" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <telerik:RadButton x:Name="EditAppointmentItem" ToolTipService.ToolTip="Edit" Height="14" Width="14" Tag="{Binding}" Click="EditAppointmentItem_Click" 
                                           HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,1,0,0" Grid.Row="0" Grid.Column="2">
                        <telerik:RadButton.Content>
                            <StackPanel Orientation="Horizontal" Margin="0">
                                <Image Source="/GroupCalendar2012;Component/Images/editIcon.png" />
                            </StackPanel>
                        </telerik:RadButton.Content>
                    </telerik:RadButton>
      
                    <telerik:RadButton x:Name="DeleteAppointmentItem" ToolTipService.ToolTip="Delete" Height="14" Width="14" Tag="{Binding}" Click="DeleteAppointmentItem_Click" Visibility="{Binding ParetoAppointmentCompletedDeleteButtonVisibility}"
                                           HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,1,2,0" Grid.Row="0" Grid.Column="3">
                        <telerik:RadButton.Content>
                            <StackPanel Orientation="Horizontal" Margin="0">
                                <Image Source="/GroupCalendar2012;Component/Images/delete.png" />
                            </StackPanel>
                        </telerik:RadButton.Content>
                    </telerik:RadButton>
      
                    <Image x:Name="CompletedImage" Height="15" Width="15" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,1,0,0" Grid.Row="0" Grid.Column="3" 
                           Visibility="{Binding ParetoAppointmentCompletedImageVisibility}" 
                           Source="/GroupCalendar2012;Component/Images/completed.png" />
      
                    <!-- Row 1 -->
                    <TextBlock x:Name="TypeLabel" Text="Type: " Grid.Row="1" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoAppointmentTypeVisibility}" />
                    <Border Background="{Binding ParetoAppointmentType.AppointmentTypeBrush}" Grid.Row="1" Grid.Column="1" />
                    <TextBlock Text="{Binding ParetoAppointmentType.AppointmentTypeName}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="1" Grid.Column="1"
                                   Foreground="{Binding ParetoAppointmentType.AppointmentTypeForegroundBrush}" />
      
                    <!-- Row 2 -->
                    <TextBlock x:Name="DivisionLabel" Text="Division: " Grid.Row="2" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoDivisionVisibility}" />
                    <Border Background="{Binding ParetoDivision.DivisionBrush}" Grid.Row="2" Grid.Column="1" />
                    <TextBlock Text="{Binding ParetoDivision.DivisionName}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1"
                                   Foreground="{Binding ParetoDivision.DivisionForegroundBrush}" />
      
                    <!-- Row 3 -->
                    <TextBlock x:Name="RegardingLabel" Text="Regarding: " Grid.Row="3" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding Converter={StaticResource AppointmentRegardingVisibilityConverter}}" />
                    <TextBlock Text="{Binding Converter={StaticResource AppointmentRegardingDisplayConverter}, ConverterParameter=nolabel}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="3" Grid.Column="1"
                                   Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
      
                    <!-- Row 4 -->
                    <TextBlock x:Name="RequiredAttendeesLabel" Text="Attendees: " Grid.Row="4" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding Converter={StaticResource AppointmentRequiredAttendeesVisibilityConverter}}" />
                    <TextBlock Text="{Binding Converter={StaticResource AppointmentRequiredAttendeesListDisplayConverter}}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="4" Grid.Column="1"
                                   Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
      
                    <!-- Row 5 -->
                    <TextBlock x:Name="LocationLabel" Text="Location: " Grid.Row="5" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoLocationVisibility}" />
                    <TextBlock x:Name="LocationText"  Text="{Binding ParetoLocation}"
                               TextWrapping="NoWrap" TextAlignment="Left" TextTrimming="WordEllipsis" Grid.Row="5" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <!-- Row 6 -->
                    <TextBlock x:Name="StartLabel" Text="Start: " Grid.Row="6" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="StartText" Text="{Binding ParetoStart, StringFormat=\{0:MM/dd/yyyy h:mm tt\}}"
                               TextWrapping="NoWrap" TextAlignment="Left" Grid.Row="6" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <!-- Row 7 -->
                    <TextBlock x:Name="EndLabel" Text="End: " Grid.Row="7" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="EndText" Text="{Binding ParetoEnd, StringFormat=\{0:MM/dd/yyyy h:mm tt\}}"
                               TextWrapping="NoWrap" TextAlignment="Left" Grid.Row="7" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                </Grid>
            </DataTemplate>
      
            <DataTemplate x:Key="GridViewRowToolTip">
                <Grid Background="{Binding ParetoOrganizer.UserBrush}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="15" />
                        <ColumnDefinition Width="15" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
      
                    <!-- Row 0 -->
                    <TextBlock x:Name="MainSubjectLabel" Text="Subject: " Grid.Row="0" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="MainSubjectText" Text="{Binding ParetoSubject}" 
                               TextWrapping="NoWrap" TextAlignment="Left" TextTrimming="WordEllipsis" Grid.Row="0" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <Image x:Name="CompletedImage" Height="15" Width="15" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,1,0,0" Grid.Row="0" Grid.Column="3" 
                           Visibility="{Binding ParetoAppointmentCompletedImageVisibility}" 
                           Source="/GroupCalendar2012;Component/Images/completed.png" />
      
                    <!-- Row 1 -->
                    <TextBlock x:Name="DescriptionLabel" Text="Description: " Grid.Row="1" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoDescriptionVisibility}" />
                    <TextBlock x:Name="DescriptionText" Text="{Binding ParetoDescription}" MaxWidth="650"
                               TextWrapping="Wrap" TextAlignment="Left" Grid.Row="1" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <!-- Row 2 -->
                    <TextBlock x:Name="TypeLabel" Text="Type: " Grid.Row="2" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoAppointmentTypeVisibility}" />
                    <Border Background="{Binding ParetoAppointmentType.AppointmentTypeBrush}" Grid.Row="2" Grid.Column="1" />
                    <TextBlock Text="{Binding ParetoAppointmentType.AppointmentTypeName}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1"
                                   Foreground="{Binding ParetoAppointmentType.AppointmentTypeForegroundBrush}" />
      
                    <!-- Row 3 -->
                    <TextBlock x:Name="DivisionLabel" Text="Division: " Grid.Row="3" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoDivisionVisibility}" />
                    <Border Background="{Binding ParetoDivision.DivisionBrush}" Grid.Row="3" Grid.Column="1" />
                    <TextBlock Text="{Binding ParetoDivision.DivisionName}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="3" Grid.Column="1"
                                   Foreground="{Binding ParetoDivision.DivisionForegroundBrush}" />
      
                    <!-- Row 4 -->
                    <TextBlock x:Name="RegardingLabel" Text="Regarding: " Grid.Row="4" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding Converter={StaticResource AppointmentRegardingVisibilityConverter}}" />
                    <TextBlock Text="{Binding Converter={StaticResource AppointmentRegardingDisplayConverter}, ConverterParameter=nolabel}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="4" Grid.Column="1"
                                   Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
      
                    <!-- Row 5 -->
                    <TextBlock x:Name="RequiredAttendeesLabel" Text="Attendees: " Grid.Row="5" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding Converter={StaticResource AppointmentRequiredAttendeesVisibilityConverter}}" />
                    <TextBlock Text="{Binding Converter={StaticResource AppointmentRequiredAttendeesListDisplayConverter}}" TextAlignment="Left" 
                                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="5" Grid.Column="1"
                                   Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
      
                    <!-- Row 6 -->
                    <TextBlock x:Name="LocationLabel" Text="Location: " Grid.Row="6" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" Visibility="{Binding ParetoLocationVisibility}" />
                    <TextBlock x:Name="LocationText"  Text="{Binding ParetoLocation}"
                               TextWrapping="NoWrap" TextAlignment="Left" TextTrimming="WordEllipsis" Grid.Row="6" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <!-- Row 7 -->
                    <TextBlock x:Name="StartLabel" Text="Start: " Grid.Row="7" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="StartText" Text="{Binding ParetoStart, StringFormat=\{0:MM/dd/yyyy h:mm tt\}}"
                               TextWrapping="NoWrap" TextAlignment="Left" Grid.Row="7" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
      
                    <!-- Row 8 -->
                    <TextBlock x:Name="EndLabel" Text="End: " Grid.Row="8" Grid.Column="0" Padding="2,0,0,0" Foreground="{Binding ParetoOrganizer.UserForegroundBrush}" />
                    <TextBlock x:Name="EndText" Text="{Binding ParetoEnd, StringFormat=\{0:MM/dd/yyyy h:mm tt\}}"
                               TextWrapping="NoWrap" TextAlignment="Left" Grid.Row="8" Grid.Column="1"
                               Foreground="{Binding ParetoOrganizer.UserForegroundBrush}"
                               HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                </Grid>
            </DataTemplate>
        </UserControl.Resources>
      
        <Grid x:Name="LayoutRoot" Background="Transparent" >
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
      
            <!-- <telerik:GridViewToggleRowDetailsColumn ExpandMode="Single" /> <telerik:GridViewDataColumn UniqueName="ParetoActivityId" DataMemberBinding="{Binding ParetoActivityId, Mode=TwoWay}" IsVisible="False" /> -->
      
            <telerik:RadGridView x:Name="CalendarGridControl" Grid.Row="0" Grid.Column="0" AutoGenerateColumns="False" telerik:StyleManager.Theme="Office_Blue" 
                                 HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                 AddingNewDataItem="CalendarGridControl_AddingNewDataItem"
                                 RowEditEnded="CalendarGridControl_RowEditEnded"
                                 CellEditEnded="CalendarGridControl_CellEditEnded"
                                 CellValidating="CalendarGridControl_CellValidating"
                                 ActionOnLostFocus="None"
                                 ValidatesOnDataErrors="InEditMode"
                                 RowLoaded="CalendarGridControl_RowLoaded"
                                 RowDetailsTemplate="{StaticResource RowDetailsTemplate}"
                                 RowDetailsVisibilityMode="VisibleWhenSelected"                            
                                 CanUserInsertRows="True"
                                 CanUserDeleteRows="True"
                                 ShowInsertRow="True"
                                 >
      
                <telerik:RadGridView.Columns>                
                      
                    <telerik:GridViewDataColumn UniqueName="ParetoSubject" DataMemberBinding="{Binding ParetoSubject, Mode=OneWay}" Header="Subject" Width="18*" TextWrapping="NoWrap" TextTrimming="WordEllipsis" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" />
                    <telerik:GridViewDataColumn UniqueName="ParetoLocation" DataMemberBinding="{Binding ParetoLocation, Mode=OneWay}" Header="Location" Width="10*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}"  />
                    <class:DateTimePickerColumn UniqueName="ParetoStart" Header="Start Date" DataMemberBinding="{Binding ParetoStart, Mode=TwoWay}" DataFormatString="{}{0:MM/dd/yyyy h:mm tt}" Width="18*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" />
                    <class:DateTimePickerColumn UniqueName="ParetoEnd" Header="End Date" DataMemberBinding="{Binding ParetoEnd, Mode=TwoWay}" DataFormatString="{}{0:MM/dd/yyyy h:mm tt}" Width="18*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" />
                    <telerik:GridViewComboBoxColumn UniqueName="ParetoAppointmentType" Header="Appointment Type" Width="14*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" 
                                                    DataMemberBinding="{Binding ParetoAppointmentType, Mode=TwoWay}" SortMemberPath="ParetoAppointmentType.AppointmentTypeName"
                                                    DisplayMemberPath="AppointmentTypeName" >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="18" CornerRadius="18">
                                        <Canvas Background="{Binding AppointmentTypeBrush}">
                                            <Canvas.Clip>
                                                <RectangleGeometry RadiusX="18" RadiusY="18" Rect="0,0,16,16"/>
                                            </Canvas.Clip>
                                        </Canvas>
                                    </Border>
                                    <TextBlock Grid.Column="1" Text="{Binding AppointmentTypeName}" />
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <telerik:GridViewComboBoxColumn UniqueName="ParetoAppointmentDivision" Header="Division" Width="14*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" 
                                                    DataMemberBinding="{Binding ParetoDivision, Mode=TwoWay}" SortMemberPath="ParetoDivision.DivisionName"
                                                    DisplayMemberPath="DivisionName" >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="18" CornerRadius="18">
                                        <Canvas Background="{Binding DivisionBrush}">
                                            <Canvas.Clip>
                                                <RectangleGeometry RadiusX="18" RadiusY="18" Rect="0,0,16,16"/>
                                            </Canvas.Clip>
                                        </Canvas>
                                    </Border>
                                    <TextBlock Grid.Column="1" Text="{Binding DivisionName}" />
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <telerik:GridViewComboBoxColumn UniqueName="ParetoAppointmentOwner" Header="Owner" Width="14*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" 
                                                    DataMemberBinding="{Binding ParetoOwner, Mode=TwoWay}" SortMemberPath="ParetoOwner.UserFullName"
                                                    DisplayMemberPath="UserFullName" >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="18" CornerRadius="18">
                                        <Canvas Background="{Binding UserBrush}">
                                            <Canvas.Clip>
                                                <RectangleGeometry RadiusX="18" RadiusY="18" Rect="0,0,16,16"/>
                                            </Canvas.Clip>
                                        </Canvas>
                                    </Border>
                                    <TextBlock Grid.Column="1" Text="{Binding UserFullName}" />
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <telerik:GridViewComboBoxColumn UniqueName="ParetoAppointmentOrganizer" Header="Organizer" Width="14*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" 
                                                    DataMemberBinding="{Binding ParetoOrganizer, Mode=TwoWay}" SortMemberPath="ParetoOrganizer.UserFullName"
                                                    DisplayMemberPath="UserFullName" >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="18" CornerRadius="18">
                                        <Canvas Background="{Binding UserBrush}">
                                            <Canvas.Clip>
                                                <RectangleGeometry RadiusX="18" RadiusY="18" Rect="0,0,16,16"/>
                                            </Canvas.Clip>
                                        </Canvas>
                                    </Border>
                                    <TextBlock Grid.Column="1" Text="{Binding UserFullName}" />
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <telerik:GridViewDataColumn UniqueName="ParetoStateCodeName" DataMemberBinding="{Binding ParetoStateCodeName, Mode=TwoWay}" Header="State" Width="8*" CellStyleSelector="{StaticResource CellBackgroundStyleSelector}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>
    </UserControl>

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Telerik.Windows.Controls;
    using GroupCalendar2012.Classes;
    using Telerik.Windows.Controls.GridView;
    using SilverCrmSoap.CrmSdk;
    using System.Windows.Browser;
    using Pareto.Crm2011.Shared.Enums.ParetoEntities;
    using System.Collections.ObjectModel;
    using System.Threading;
      
    namespace GroupCalendar2012.Views
    {
        public partial class CalendarGrid : UserControl
        {
            #region " Global Vars "
      
            private static CalendarGrid Instance;
            public delegate void GridComboBoxDataLoadedCallback();
            public event GridComboBoxDataLoadedCallback ComboBoxDataLoaded;
      
            #endregion
            #region " Pre-Load / Load "
      
            public CalendarGrid()
            {
                Instance = this;
                InitializeComponent();
      
                if (MainPage.GetInstance() != null)
                {
                    MainPage.GetInstance().PreloadingCompleted += new MainPage.PreloadingCompleteCallback(ComboBoxData_PreloadingCompleted);
                }
            }
      
            void ComboBoxData_PreloadingCompleted()
            {
                PopulateGridDropDowns();
                if (ComboBoxDataLoaded != null)
                {
                    try
                    {
                        ComboBoxDataLoaded();
                    }
                    catch (Exception ex)
                    {
                        MainPage.Debug(ex);
                    }
                }
            }
      
            #endregion
            #region " Populate Drop Downs "
      
            public void PopulateGridDropDowns()
            {
                (CalendarGridControl.Columns["ParetoAppointmentType"] as GridViewComboBoxColumn).ItemsSource = new ObservableCollection<AppointmentType>(GroupCalendarGlobals.AppointmentTypeCache.Values);
                (CalendarGridControl.Columns["ParetoAppointmentDivision"] as GridViewComboBoxColumn).ItemsSource = new ObservableCollection<Division>(GroupCalendarGlobals.DivisionCache.Values);
                (CalendarGridControl.Columns["ParetoAppointmentOwner"] as GridViewComboBoxColumn).ItemsSource = new ObservableCollection<SystemUser>(GroupCalendarGlobals.UserCache.Values);
                (CalendarGridControl.Columns["ParetoAppointmentOrganizer"] as GridViewComboBoxColumn).ItemsSource = new ObservableCollection<SystemUser>(GroupCalendarGlobals.UserCache.Values);
            }
      
            #endregion
            #region " Properties "
      
            public static CalendarGrid GetInstance()
            {
                return Instance;
            }
      
            #endregion
            #region " Row Loaded (ToolTip) "
      
            private void CalendarGridControl_RowLoaded(object sender, RowLoadedEventArgs e)
            {
                var row = e.Row as GridViewRow;
                if (row != null)
                {
                    ToolTip toolTip = new ToolTip()
                    {
                        Content = row.DataContext,
                        ContentTemplate = (DataTemplate)this.Resources["GridViewRowToolTip"]
                    };
                    ToolTipService.SetToolTip(row, toolTip);
                }
            }
      
            #endregion
            #region " Row Edit Ended "
      
            private void CalendarGridControl_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
            {
                if (e.EditAction == GridViewEditAction.Cancel)
                {
                    return;
                }
            }
      
            #endregion
            #region " Cell Edit Ended "
      
            private void CalendarGridControl_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
            {
                if (e.EditAction == GridViewEditAction.Cancel)
                {
                    return;
                }
      
                RadGridView grid = (RadGridView)sender;
      
                if (e.EditAction == GridViewEditAction.Commit)
                {
                    //Lock the row until update completes
                    //e.Cell.ParentRow.IsEnabled = false;
      
                    //ParetoAppointment appt = (ParetoAppointment)e.Cell.DataContext;
                    ParetoAppointment appointment = (ParetoAppointment)e.Cell.ParentRow.DataContext;
                      
                    //*** TELERIK SUPPORT NOTE
                    //*** HERE THE OBJECT IS MISSING ITS GUID - HAPPENS ONLY SOMETIMES (ParetoActivityId)
      
      
                    if (appointment != null)
                    {
                        if (appointment.ParetoActivityId != Guid.Empty)
                        {
                            //Update
                            switch (e.Cell.DataColumn.UniqueName)
                            {
                                case "ParetoAppointmentType":
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                                case "ParetoAppointmentDivision":
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                                case "ParetoAppointmentOwner":
                                    AssignEntity(appointment, e.Cell.ParentRow);
                                    break;
                                case "ParetoAppointmentOrganizer":
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                                case "ParetoStart":
                                    DateTime originalStart = (DateTime)e.OldData;
                                    TimeSpan appointmentLength = appointment.ParetoEnd - originalStart;
                                    DateTime newStart = (DateTime)e.NewData;
                                    appointment.ParetoEnd = newStart + appointmentLength;
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                                case "ParetoEnd":
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                                default:
                                    UpdateEntity(appointment, e.Cell.ParentRow, e.Cell);
                                    break;
                            }
                        }
                        else
                        {
                            //Create
                            CreateEntity(appointment, e.Cell.ParentRow);
                        }
                    }
                }
            }
      
            #endregion
            #region " Cell Validation "
      
            private void CalendarGridControl_CellValidating(object sender, GridViewCellValidatingEventArgs e)
            {
                ParetoAppointment appointment = e.Row.DataContext as ParetoAppointment;
                //ParetoAppointment appointment = e.Cell.DataContext as ParetoAppointment;
      
                switch (e.Cell.DataColumn.UniqueName)
                {
                    case "ParetoSubject":
                        if (e.NewValue == null || e.NewValue.ToString().Length <= 0)
                        {
                            e.IsValid = false;
                            e.ErrorMessage = "Subject is a required field.";
                        }
                        break;
                    case "ParetoEnd":
                        if ((DateTime)e.NewValue < appointment.ParetoStart)
                        {
                            e.IsValid = false;
                            e.ErrorMessage = "End Date MUST be after Start Date.";
                        }
                        break;
                }
            }
      
            #endregion
            #region " Create / Update / Assign - Entity "
      
            private void CreateEntity(ParetoAppointment appointment, GridViewRowItem row)
            {
                Entity createEntity = ParetoHelpers.ConvertNewParetoAppointmentToEntity(appointment);
                QueryHelpers.CreateEntity(createEntity, (res) =>
                {
                    if (res.Exception != null)
                    {
                        MainPage.Debug(res.Exception);
                    }
                    else
                    {
                        appointment.ParetoActivityId = res.Id;
      
                        //Set State to Scheduled
                        ParetoHelpers.SetState(() =>
                        {
                            //Unlock the row the Create has completed
                            Dispatcher.BeginInvoke((Action)(() =>
                            {
                                //row.IsEnabled = true;
                            }));
      
                        }, appointment.ParetoActivityId, AppointmentEntityProperties.PrimaryEntityName,
                          (Int32)AppointmentEntityProperties.StateCodeName.Scheduled,
                          (Int32)AppointmentEntityProperties.StatusCodeName.Busy);
      
      
                    }
                }, createEntity);
            }
      
            private void UpdateEntity(ParetoAppointment appointment, GridViewRowItem row, GridViewCell cell)
            {
                Entity updateEntity = ParetoHelpers.ConvertParetoAppointmentToEntity(appointment);
                QueryHelpers.UpdateEntity(updateEntity, (res) =>
                {
                    if (res.Exception != null)
                    {
                        MainPage.Debug(res.Exception);
                    }
                    else
                    {
                        //Unlock the row the update has completed.
                        Dispatcher.BeginInvoke((Action)(() =>
                        {
                           //row.IsEnabled = true;
                        }));
                    }
                }, updateEntity);
            }
      
            private void AssignEntity(ParetoAppointment appointment, GridViewRowItem row)
            {
                EntityReference appointmentRef = new EntityReference() { LogicalName = AppointmentEntityProperties.PrimaryEntityName, Id = appointment.ParetoActivityId };
      
                EntityReference ownerRef = new EntityReference() { LogicalName = SystemUserEntityProperties.PrimaryEntityName, Id = appointment.ParetoOwner.UserId };
                ParetoHelpers.AssignAppointmentOwner(() =>
                {
                    //Unlock the row the update has completed.
                    Dispatcher.BeginInvoke((Action)(() =>
                    {
                        //row.IsEnabled = true;
                    }));
                }, ownerRef, appointmentRef);
            }
      
            #endregion
            #region " Add New Appointment Item "
      
            private void CalendarGridControl_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
            {
                RadGridView grid = (RadGridView)e.OwnerGridViewItemsControl;
                grid.CurrentColumn = grid.Columns["ParetoSubject"];
            }
      
            #endregion
            #region " Edit Appointment Item "
      
            private void EditAppointmentItem_Click(object sender, RoutedEventArgs e)
            {
                RadButton button = (RadButton)sender;
                ParetoAppointment currentAppointment = (ParetoAppointment)CalendarGridControl.SelectedItem;
                //ParetoAppointment currentAppointment = (ParetoAppointment)CalendarGridControl.RowDetailsProvider.DataContext;  //SelectedCells;
                String stringUri = Crm2011.GetServerUrl() + Crm2011.GetEditPageUrl(currentAppointment.ParetoActivityId);
                HtmlPage.Window.Invoke("openStdWin", stringUri, "_blank", GroupCalendarProperties.PopupWidth, GroupCalendarProperties.PopupHeight);
            }
      
            #endregion
            #region " Delete Appointment Item "
      
            private void DeleteAppointmentItem_Click(object sender, RoutedEventArgs e)
            {
                ParetoAppointment currentAppointment = (ParetoAppointment)((RadButton)sender).Tag;
                 
                RadWindow.Confirm(GroupCalendarProperties.DeleteActionConfirmMessage, (wsender, we) =>
                {
                    if (we.DialogResult == true)
                    {
                        MainPage.Busy = true;
                        Classes.QueryHelpers.DeleteEntity(new EntityReference()
                        {
                            LogicalName = AppointmentEntityProperties.PrimaryEntityName,
                            Id = currentAppointment.ParetoActivityId
                        }, (resp) =>
                        {
                            GroupCalendarGlobals.CurrentView = CurrentViewEnum.Grid;
                            MainPage.GetInstance().RefreshGroupCalendar();
                            if (resp.Exception != null)
                            {
                                MainPage.Debug(resp.Exception.Message + "\r\n" + resp.Exception.StackTrace);
                            }
                        }, null);
                    }
      
                });
            }
      
            #endregion
        }
    }

  2. Don
    Don avatar
    6 posts
    Member since:
    Sep 2007

    Posted 18 Jan 2012 Link to this post

    I found that my Guid to my custom object was blanked due to my override CopyFrom function that extends the AppointmentBase class. I am using the RadScheduleView and RadGridView for displaying custom appointment data.
    I do not think the old dll was ever going into this CopyFrom, It happens on each cell edit. I still do not get my row details updating after each cellEditEnd, but I am now able to keep my custom objects Guid intact.
    public override void CopyFrom(IAppointment other)
           {
               base.CopyFrom(other);
               var appointment = other as ParetoAppointment;
               if (appointment != null)
               {
                   ParetoActivityId = appointment.ParetoActivityId; //new Guid(); <---- This was how my Guid was blanking out.
                   ParetoSubject = appointment.paretoSubject;
                   ParetoStart = appointment.paretoStart;
                   ParetoEnd = appointment.paretoEnd;
                   ParetoIsAllDay = appointment.paretoIsAllDay;
                   Category = appointment.Category;
                   TimeMarker = appointment.TimeMarker;
               }
           }

  3. Don
    Don avatar
    6 posts
    Member since:
    Sep 2007

    Posted 19 Jan 2012 Link to this post

    I have the Row Details updating after RowEditEnded would fire. I want to have the row details updating after Each CellEditEnded Event fires, so that as the user edits the cells the Row Details reflect the new change. Currently the user has to click the 'Commit Row' Button that appears on the left during cell/row editing to see the Details Row show the updated information.
  4. Tommy Z
    Tommy Z avatar
    9 posts
    Member since:
    Sep 2009

    Posted 19 Jan 2012 Link to this post

    In your GridView, try setting the SelectionUnit property to Cell.
  5. Don
    Don avatar
    6 posts
    Member since:
    Sep 2007

    Posted 19 Jan 2012 Link to this post

    Thanks for the reply, but no that does not fix the issue.
    It seems that the refresh for row details no longer automatically happens after each cell edit,
    Only after the row commits are the changes shown.
    Used to be able to tab out of a cell and see my details change.
Back to Top