GridViewComboBoxColumn on change to update two other columns

3 posts, 1 answers
  1. Greg
    Greg avatar
    17 posts
    Member since:
    Oct 2010

    Posted 14 Jan 2015 Link to this post


    I'm a noob to WPF. I inherited an MVVM WPF project using Caliburn.Micro.

    I have this gridview:
    <telerik:RadGridView Margin="10"
                                 ItemsSource="{Binding SelectedCollectionPatient.CollectionTests}"
                                 SelectedItem="{Binding SelectedCollectionTest}"
                                <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:GridViewDataColumn Width="*" IsReadOnly="False"
                                                DataMemberBinding="{Binding CollectionTime, StringFormat='{}{0:hh:mm tt}' }">
                                            <StackPanel Orientation="Horizontal">
                                                <telerik:RadMaskedDateTimeInput Margin="0"
                                                                         EmptyContent="No Time Entered"
                                                                         Height="50" Width="150" Mask="hh:mm tt"
                                                                         Value="{Binding CollectionTime, UpdateSourceTrigger=PropertyChanged}">
                                                <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:GridViewComboBoxColumn ItemsSource="{Binding SelectedCollectionPatient.ReasonList}"                                                         
                                                    Width="165" IsReadOnly="False"
                                                    DataMemberBinding="{Binding UncollectedReasonId}"
                                                    Header="Uncollected Reason">

    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)


  2. Answer
    Dimitrina avatar
    3769 posts

    Posted 15 Jan 2015 Link to this post


    You can check the Handle SelectionChanged for the GridViewComboBoxColumn article. Once the selection has changed, you can proceed further with your additional information.


    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
  4. Greg
    Greg avatar
    17 posts
    Member since:
    Oct 2010

    Posted 15 Jan 2015 in reply to Dimitrina Link to this post

    Thanks. Got it working perfectly.

    I had to to do some clever coding to figure out which combobox was firing. Not sure why uniquename is not there.
Back to Top