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

ShowInsertRow and MouseDoubleClick

6 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thibaut
Top achievements
Rank 1
Thibaut asked on 28 Jun 2010, 10:48 AM
hello,

I would like to know if it is possible to detect a double-click on the row "Click here to add a new item"
to prevent an exception in radGridView1_MouseDoubleClick

best regards
thibaut

6 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 28 Jun 2010, 12:37 PM
Hello thibaut,

Could you please provide more information about the exception that you are getting? There might be a better way to handle it than subscribing to events of the new row.


Kind regards,
Milan
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
0
Thibaut
Top achievements
Rank 1
answered on 28 Jun 2010, 01:45 PM
  1. I have a ragridview binding an observable collection of items.
    I need to facilitate to add new items to my users. For this, I have added a button "insert" in my control, I have set ShowInsertRow to true and I use too the MouseDoubleClick event to add a new item to my collection.
    Thats Ok except when I click on the row "Click here to add a new item"...
  2. More generaly, I am not sure to use the ShowInsertRow option. I would prefer a new blank row at bottom, always visible. A new empty row should appear immediately after the insert of the object into the collection.
    I didn't find anything about that in the Public Isssue Tracking System.
0
Milan
Telerik team
answered on 28 Jun 2010, 01:59 PM
Hello thibaut,

If you are binding to an ObservableCollection and ShowInsertRow is false, new blank row should be added at the bottom of the grid when Insert key is pressed.

I have attached a sample project which demonstrates this approach.


Kind regards,
Milan
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
0
Thibaut
Top achievements
Rank 1
answered on 28 Jun 2010, 02:09 PM
  1. I'm sorry there's a misunderstanding. I want to multiply the ability to add a new item to my users.
    I use both button "insert",  ShowInsertRow=true and MouseDoubleClick event.
    MouseDoubleClick event adds a item but doubleclicking on the row  "Click here ..." throws an exception
  2. ?...
0
Milan
Telerik team
answered on 28 Jun 2010, 07:30 PM
Hello thibaut,

Could you please send us your project so that we can take a look at the exception and offer a solution.

Thank you for your cooperation.


Best wishes,
Milan
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
0
Thibaut
Top achievements
Rank 1
answered on 29 Jun 2010, 02:33 PM
It is a re-entry exception. I fixed it by checking
if
 (radGridView1.RowInEditMode != null && radGridView1.RowInEditMode is GridViewNewRow)

Tags
GridView
Asked by
Thibaut
Top achievements
Rank 1
Answers by
Milan
Telerik team
Thibaut
Top achievements
Rank 1
Share this question
or