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

DataLoaded timing?

1 Answer 134 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Nathan asked on 27 May 2010, 06:59 PM

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!


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 28 May 2010, 07:14 AM
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.
Asked by
Top achievements
Rank 2
Answers by
Telerik team
Share this question