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,
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.
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?
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.
Thanks for the quick reply. I'm using codebehind to set all my fields. And I have many fields that need to be set. Is it possible to set may fields at once in codebehind instead of using xaml?
If you want to do this in code – behind you can use the following code:
Field myField = new Field(); myField.Settings.EditAsType = typeof(String);
Hope this helps you.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I have been looking into your requirement and I created a sample project for you with the functionality you want to achieve. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Ok. I have run into a little problem. I said multiply but what I was needing is to add to numbers together and then divided them by 2 like this. 10.75+12.00 = 22.75 / 2 = 11.37
Also I get an error with this code
if (e.Editor.Value.ToString().Contains('*'))
if I select on a cell that is empty.
Also is it possible to change the cell back to this format $11.37 when I move off the cell. This was the format originally before we change the type to string. I thought It may need to be changed back so I do not get an error when updating the database.
Thanks