We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Escape key on AddNewRow sometimes skpis RowValidating event and allows to show data.

Thread ID:

Created:

Updated:

Platform:

Replies:

118590 Mar 20,2015 11:35 PM UTC Mar 25,2015 12:18 PM UTC WPF 3
loading
Tags: SfDataGrid
ANGEL ADRIAN VELAZQUEZ RAMOS
Asked On March 20, 2015 11:35 PM UTC

Good Day,

I have this issue where I click on add new row, then press one time the escape key, click to re-enter to edit mode again and press escape key again and when I leave the row this time the grid does not trigger the validations and add the invalid data or at least it displayed like a new added row  (note: that I have the grid on EditTrigger = OnTap)..

Thanks and Regards

Saravanan M [Syncfusion]
Replied On March 23, 2015 09:41 AM UTC

Hi Angel,

Thank you for Contacting Syncfusion support,

We have analyzed your query. When you Press escape key two times, validation will be clear , this is the behavior of SfDataGrid. But you can keep the validation on by overriding SelectionController and CurrencyManager. Please refer the below code snippet.

Code snippet[C#]:

this.sfDataGrid.SelectionController = new CustomGridSelectionController(this.sfDataGrid);

public class CustomGridSelectionController:GridSelectionController

{ .

.

protected override GridCurrentCellManager CreateCurrentCellManager()

{

var currentcellManager = new CustomCurrentCellManager(this.DataGrid,this.SuspendUpdates,this.ResumeUpdates);

return currentcellManager;

}

.

.

}

public class CustomCurrentCellManager:GridCurrentCellManager

{

public override bool HandleKeyNavigation(KeyEventArgs args, RowColumnIndex rowColumnIndex)

{

if (args.Key == Key.Escape && !this.CurrentCell.IsEditing)

{

return true;

}

return base.HandleKeyNavigation(args, rowColumnIndex);

}

}

We have prepared a sample based on this and you can download it from below location,

Sample Location: SfDataGrid_Validation.zip

Please let us know if you have any other queries,

Regards,

Saravanan.M


ANGEL ADRIAN VELAZQUEZ RAMOS
Replied On March 23, 2015 06:46 PM UTC

Hi Saravanan,

I appreciate the support and the example, but I really want is the user capability to cancel add new row without this little issue that I am facing. 

I couldn´t reproduce the issue with the provided code, so I added a column which has a list of names on a GridMultiColumnDropDownList (silly code might be) as I have it in my grid; 

If you click on addnewrow on CustomerName Column, then trigger the validation (clic outside the row), after that press esc key, clic inside the same column again and finally press esc key again, the next time that you have clicked outside the row, it will allow me to add the row without following the validation.


I know that this might look like a rare case but I think I am using or I am declaring something wrong.



Thanks and Regards,

Angel


Attachment: SampleApplication_c1064a41.rar

Saravanan M [Syncfusion]
Replied On March 25, 2015 12:18 PM UTC

Hi Angel,

We were able to reproduce the problem and wehave logged defect report regarding this. A support incident #137088 to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,

Saravanan.M


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;