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

Do not call EndEdit on leaving row

3 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 25 Oct 2013, 12:18 PM
Hello,

how can I avoid that the EndEdit Method of my entity is raised when leaving/switching the row.
I changed the ActionOnLostFocus to "None", but this was not the solution.

Thank you,
Manuel

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 29 Oct 2013, 05:49 PM
Hi Manuel,

Indeed, you are right, this property works on a GridView level, not on a row level. May I ask you to give us some more information about your scenario, so we can think of any workaround. 

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Manuel
Top achievements
Rank 1
answered on 29 Oct 2013, 06:03 PM
Hi Yoan,

I have an ObservableCollection<T> bount to a GridView.
The user has the possibility to edit multiple rows.
After the changes are done, the user can click on the save or cancel button.
Thats it.

Thank you,
Manuel
0
Yoan
Telerik team
answered on 01 Nov 2013, 04:13 PM
Hello Manuel,

Here is a workaround - you can subscribe to GridView's PreviewMouseLeftButtonDown event and execute the following logic:

private void clubsGrid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement originalSource = e.OriginalSource as FrameworkElement;
            GridViewRow clickedRow = originalSource.ParentOfType<GridViewRow>();
            RadGridView gridView = sender as RadGridView;
 
            if (gridView.RowInEditMode != null &&
                clickedRow != null &&
              !clickedRow.IsInEditMode)
                e.Handled = true;
        }


I hope this helps.
Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Manuel
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Manuel
Top achievements
Rank 1
Share this question
or