Hello,
I have a simple grid with two columns and I am trying click event to be redirected to the neighboring cell, so edit would be activated.
Right now when I click the left cell, I get this:
When I click the left cell, the result I am looking for is this:
I am not sure what would be the best way to approach it. Should I write a custom template or handle the event in the code?
Thank you.
Thanks, it is helpful.
I am just checking if my post was helpful for you.
If you require any further assistance please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
The reason that you are getting this result is that the data type of the Age field is string and you are using XamNumericEditor. The XamNumericEditor is used for editing numeric data and you can avoid this behavior by:
1. Changing the property’s type that the Field is bound to, to numeric data type.
2. Set FieldSettings’ EditAsType property to some of the numeric data types. For example:
<Window
………………………………………
xmlns:sys="clr-namespace:System;assembly=mscorlib"
<igDP:Field Name="Age" Label="Ages">
<igDP:Field.Settings>
<igDP:FieldSettings
EditAsType="{x:Type sys:Int32}"
If you require any further assistance on the matter please do not hesitate to ask.
Thanks for quick reply. I tried both solutions you have suggested, but for some reason the value is not shown correctly, although it seems to be bound to the editor, so the end result looks like this:
Could you suggest how or where I should look to resolve it? Should I look at ValueConverter?
If you want to use XamNumericEditor in your cell I can suggest you to set FieldSettings’ EditorType property to XamNumericEditor. You can do that as follows:
<igDP:FieldSettings EditorType="{x:Type igEditors:XamNumericEditor}">
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
By doing so you will keep the functionality that you need and you will have XamNumericEditor in your cell. You can also add this:
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamNumericEditor}">
<!-- Change editor's setting if needed -->
</Style>
</igDP:FieldSettings.EditorStyle>
in the FieldSettings for the Field that you want in order to change the XamNumericEditor as you need.