Hello,
I'm a noob to WPF. I inherited an MVVM WPF project using Caliburn.Micro.
I have this gridview:
When the CurrentStatus combo box column is changed, I want to check the status and:
1) update or clear the CollectionTime (the masked input)
2) update or clear the UncollectedReason column
I'm current trying to do it in the RadGridView_CellEditEnded event... but haven't been able to figure it out.
Thanks.
I'm a noob to WPF. I inherited an MVVM WPF project using Caliburn.Micro.
I have this gridview:
<telerik:RadGridView Margin="10" CanUserFreezeColumns="False" MaxHeight="300" RowIndicatorVisibility="Collapsed" IsReadOnly="False" ScrollMode="Deferred" BeginningEdit="RadGridView_BeginningEdit" CellEditEnded="RadGridView_CellEditEnded" ScrollViewer.PanningMode="VerticalFirst" ScrollViewer.HorizontalScrollBarVisibility="Visible" ItemsSource="{Binding SelectedCollectionPatient.CollectionTests}" SelectedItem="{Binding SelectedCollectionTest}" AutoGenerateColumns="False" IsFilteringAllowed="False" ShowGroupPanel="False" > <telerik:RadGridView.Columns> <telerik:GridViewComboBoxColumn ItemsSource="{Binding Path=DataContext.SelectedCollectionPatient.CurrentStatusList, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Width="145" IsReadOnly="False" DataMemberBinding="{Binding CurrentStatus}" Header="Collection Status" UniqueName="CurrentStatus" > </telerik:GridViewComboBoxColumn> <telerik:GridViewDataColumn Width="*" IsReadOnly="False" DataMemberBinding="{Binding CollectionTime, StringFormat='{}{0:hh:mm tt}' }"> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <telerik:RadMaskedDateTimeInput Margin="0" telerik:TouchManager.IsTouchHitTestVisible="False" EmptyContent="No Time Entered" VerticalContentAlignment="Center" Height="50" Width="150" Mask="hh:mm tt" Value="{Binding CollectionTime, UpdateSourceTrigger=PropertyChanged}"> </telerik:RadMaskedDateTimeInput> <telerik:RadButton Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SetCurrentTimeCommand}" Width="35" Margin="0"> <Image Source="/HomeCollections.UI;component/Images/Icons/time.png" Width="16" Stretch="None"></Image> </telerik:RadButton> </StackPanel> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> <telerik:GridViewComboBoxColumn ItemsSource="{Binding SelectedCollectionPatient.ReasonList}" Width="165" IsReadOnly="False" DisplayMemberPath="ReasonText" SelectedValueMemberPath="UncollectedReasonId" DataMemberBinding="{Binding UncollectedReasonId}" Header="Uncollected Reason"> </telerik:GridViewComboBoxColumn> </telerik:RadGridView.Columns> </telerik:RadGridView>When the CurrentStatus combo box column is changed, I want to check the status and:
1) update or clear the CollectionTime (the masked input)
2) update or clear the UncollectedReason column
I'm current trying to do it in the RadGridView_CellEditEnded event... but haven't been able to figure it out.
if (e.Cell.Column.UniqueName == "CurrentStatus") { if (e.NewData != e.OldData) {}}Thanks.
