JNJayaleshwari N Syncfusion Team July 9, 2015 08:46 AM UTC
Thank you for using Syncfusion Products.
We have analyzed your query “How to programatically cancel adding a new row” by using AddNewRowController and its methods. Due to its protection level, you could not use them directly, but you can achieve them by reflection. We have prepared a simple sample based on your requirement. You can download it from the following location.
In the above sample, we haveused two buttons – Cancel and Commit AddNewRow. You can get the AddNewRowController using reflection from GridModel. It has CancelAddNew and CommitAddNew methods. CancelAddNew reverts the edited value and cancel the AddNewRow to be added to grid. CommitAddNew commits the entered value and include AddNewRow to grid. We already have a KB document related to this query. Please refer the following KB link for your reference. KB link: http://www.syncfusion.com/kb/5099/how-to-do-addnewrow-operations-programmatically-in-the-sfdatagrid Please let us know if this solution helps you.
BKBrett KlopferJuly 10, 2015 04:31 AM UTC
Thanks very much for your solution.
Is there future chance that these methods will be accessible directly rather than via reflection?
JNJayaleshwari N Syncfusion Team July 14, 2015 04:04 PM UTC
Hi Brett, We have analyzed your requirement “To change the protection level of AddNewRowController”. We will change the accessibility of AddNewRowController class as public and these changes will be reflected in our upcoming release 2015 Volume 3. Please let us know, if you have any other queries. Regards, Jayaleshwari N.