Hi,
In products like Excel you can multiply two numbers by typing this example 2*4 in the cell, the cell would do the math and the cell would contain 8 as the results of the math. Is this possible in the xamDatagrid?
Thanks,
Bryan K
Hello Bryan,
You can set your Field’s FiledSettings’ EditAsType Property to String, so your values are edited as Strings and the suggestion from previous post will work. You can do something like this, where "Age" is the Property’s Name of the underlying object and "sys" refers to the clr-namespace:System;assembly=mscorlib namespace:
<igDP:Field Name="Age"> <igDP:Field.Settings> <igDP:FieldSettings EditAsType="{x:Type sys:String}"/> </igDP:Field.Settings> </igDP:Field>
Please let me know if this helps you or you need further clarifications on this matter.
Sorry for the delay but this did not work. I'm binding to a database and this column is a decimal (18,2). When I try to edit the cell the cell will not except the key stroke *. How can I get around this behavior?
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking into and suggest you add the following code in your XamDataGrid’s EditModeEnding event:
if (e.Editor.Value.ToString().Contains('*')) { string[] tmp = e.Editor.Value.ToString().Split('*'); double result = 1; for (int i = 0; i < tmp.Length; i++) { result *= Double.Parse(tmp[i]); } e.Editor.Value = result; }
Please let me know if this is what you want to achieve or I have misunderstood you in some way.
Looking forward for your reply.