DataLoaded timing?

2 posts, 1 answers
  1. Nathan
    Nathan avatar
    24 posts
    Member since:
    Sep 2009

    Posted 27 May 2010 Link to this post


    I'm having some trouble with a Telerik RadGridView where I want to be able to tell if the user clicked a checkbox vs. it being set via the binding. This is so I can set a "dirty" status and let them know they have made changes that require saving.

    My first approach:
    1) Set a loading=true flag when I'm about to bind to my collection of objects
    2) Set loading=false in the DataLoaded event
    3) on checkbox_checked event, as long as loading=false it is the user, not a binding causing the change in value
    This approach did not work. I get the DataLoaded event, and then a short while later I get the checkbox_checked event for any rows that are bound to a "true" value. Is there a reason DataLoaded fires before the checkboxes get checked? I assumed DataLoaded would only fire once all binding/setting of values was complete. Note that I have turned on/off IsSynchronizedWithCurrentItem, and also made sure DataLoadMode is Synchronous.

    The second approach was to try to trap a mouseup/down event on the checkbox itself, as that way I know it's the user, not a binding changing the value. Unfortunately I do not receive these mouse events (I assume they are gobbled up by the grid?)

    Here is the declaration of the Grid in case you can spot a mistake I am making:
    <telerikGridView:RadGridView x:Name="dgUserPrefs"   
                        <telerikGridView:GridViewDataColumn Header="Shift Type" DataMemberBinding="{Binding SHIFT_TYPE_DESC}" UniqueName="Shift Type"></telerikGridView:GridViewDataColumn> 
                        <telerikGridView:GridViewDataColumn Header="Preference" UniqueName="Preference" HeaderTextAlignment="Center" 
                                    <CheckBox x:Name="chBoxPriority"   
                                         IsChecked="{Binding PRIORITY, Mode=TwoWay}" 

    Any help on this would be appreciated!

  2. Answer
    Milan avatar
    1989 posts

    Posted 28 May 2010 Link to this post

    Hi Nathan Riske,

    You could try to use the CLick event:

    <telerik:GridViewDataColumn Header="Preference" UniqueName="Preference" HeaderTextAlignment="Center">
                <CheckBox x:Name="chBoxPriority"   
                         IsChecked="{Binding Checked, Mode=TwoWay}" 

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top