Hi,
I am using xamdatagrid and i found this issue.When a cell is having some value if i delete it and instead of giving value if i press the up down keys the value comes automatically as -9999999.Can u suggest any solution for it.
Thanks in advance
Manuj
Hello Manuj,
I have been looking into your issue and I am not able to reproduce it. Would you please tell me whether you are using some specific editor for the field whose cells you are editing? By default when I delete the value in a cell and press ‘Up’ or ‘Down’ arrow, the value does not change.
Looking forward to hearing from you.
Hi Yanko Nikolov ,
Thanks for your reply.
I am using unbound field and in the field settings i am using edit as type as shown below
EditAsType="{x:Type sys:Int16}"
I have also noticed this issue in WPF netadvantage feature browser under xamdatgrid->Data Binding and Interactions-> Unbound Fields, check any filed like Price,Quality etc.
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
Thank you for your reply. I assume that you would like not to change the value with the up arrow key when it is null in the unbound field. If it is true, I can suggest you define a style for the XamNumericEditor and define a EcentSetter for the ‘PreviewKeyDown’ event like :
<Style TargetType="{x:Type igEditors:XamNumericEditor}">
<EventSetter Event="PreviewKeyDown" Handler="KeyDownEvent"/>
</Style>
…
void KeyDownEvent(object sender, KeyEventArgs e)
{
if ((sender as XamNumericEditor).DisplayText == "" && e.Key== Key.Up)
e.Handled = true;
}
This way when the value is empty and press the ‘Up’ arrow, the value won’t become – 9999999.
If you need any further assistance on this matter, feel free to ask.