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

how to stop auto commit

5 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Li
Top achievements
Rank 1
Li asked on 09 Feb 2011, 05:47 PM
Hi,

I'm using gridView for my application which include insert, edit, delete operations. During insert/Edit the row, if I click any other row/cell, the CommitEdit() is fired. How do I stop this event?

Thanks,

Li

5 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 09 Feb 2011, 06:20 PM
Hi Li,

This behavior is controlled by the ActionOnLostFocus property of RadGridView. You can set it to None.

All the best,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Li
Top achievements
Rank 1
answered on 09 Feb 2011, 06:26 PM
I have set ActionOnLostFocus = None; This only prevents committing when click another control. If I click another row, it commits editing row.
0
Veselin Vasilev
Telerik team
answered on 10 Feb 2011, 02:48 PM
Hello Li,

You are right - this property works on a gridview level, not on a row/cell levels.

Can you give us some more information about your scenario, so we can think of any workaround.

Kind regards,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Li
Top achievements
Rank 1
answered on 10 Feb 2011, 02:58 PM
I found a workaround by using PreviewMouseLeftButonDown event, let me know if you have better way to do it. Thanks.

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;

 

0
Henky Wibowo
Top achievements
Rank 1
answered on 16 Feb 2012, 02:31 AM
What is the equivalent of PreviewLeftMouseButtonDown event in Silverlight?
Tags
GridView
Asked by
Li
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Li
Top achievements
Rank 1
Henky Wibowo
Top achievements
Rank 1
Share this question
or