Hello.
I have a problem with the XamWebNumericEditor and XamWebMaskedEditor. If I put one of these controls on my view and run the application, it crashes with the following error:
AG_E_PARSER_BAD_TYPE [Line: 450 Position: 117]
(see attached screenshot).
The code in XAML is quite simple:<igEdit:XamWebNumericEditor Canvas.Left="682" Canvas.Top="57" Text="100" TextWrapping="NoWrap" />
or
<igEdit:XamWebMaskedEditor Canvas.Left="698" Canvas.Top="65" Text="100" TextWrapping="Wrap" Mask="999"/>
System information:OS: Windows 7 Ultimate 32BitSilverlight controls v9.2Expression Studio 3 SP1Language: German
Any ideas what the problem could be?
Ralf
Hi Ralf,
Could you provide some more information, for example:
-which of the two XAML code lines above is at the specified location (line 450)?
-also, if possible, please provide some more of the XAML code, in what container is placed the editor, etc.
Thanks in advance,
Hi Stoimen,
In line 450 of the XAML-file the following code is found:
<igEdit:XamWebNumericEditor Canvas.Left="682" Canvas.Top="57" Text="100" TextWrapping="NoWrap" />
The page is structured as followes:
<Border> <Canvas> <igEdit:XamWebNumericEditor /> </Canvas></Border>
So the editor conttrol resides on a canvas within a border. I need a canvas because I have a lot of controls (textblock and textbox). A grid with the corresponding rows and columns would drive me nuts;-) A canvas is much easier for me to handle. I don't hope that the border or canvas is causing the problem.
Hi Ralf.
You can specify ValueType in xaml using this syntax ValueType="System:Single". XamWebNumericEditor supports the following types Int16, Int32, Int64, Double and Single. More about ValueType you can read in this post http://forums.infragistics.com/forums/t/35244.aspx where Doychin Dochev explains in details about Expression Blend.
Examples for editor you can find on our sample browser http://labs.infragistics.com/silverlight/lobsamples/2009.2/ where the code is posted too.
Good luck with Silverlight!
Dimitrina Siderova
Software Engineer In Test
Hi Dimitrina.
I took a look at the post and also the samples but I could not get it running:-(By specifying "System:Double" I got an error that the namespace "System" ist not available, so I added a reference to mscorlib (see attached file). I hope, that is the right assembly. After that the error went away but I got a new one that is identical to the error mentioned in the post of your previous message.I tried different combinations of [Mask] and [Valuetype] but the error is still the same. The other value types (e.g. System:Int16) also won't work. The error message is always the same: "The new assigned value: xx is not of type: {Double|Int16|ect.}"
I have no idea what the problem could be. The XAML file is as simple as possible (see attached file). What I'm missing is a documentation of valid placeholders for the mask. In my local installed documentation I couldn't find anything about that.
If you find any errors in my XAML file could you please fix them and send it back to me? Would be nice if you include some examples for the following masks:Double values: 1234,56Integer values: 123Each mask should be available in a version where input is required for all placeholders and one version where the user can omit one or more leading numbers.
Thank you.
when you want to use editor for numbers and specify numeric value types it has to be done with XamWebNumericEditor. It supports Int16, Int32, Int64, Single and Double types. Also, when you use mask in XamWebNumericEditor the mask type is {double:-n.m} where n is number of digits in integer part and m is number of digits in fraction part, minus is set if negative numbers is permitted to be entered. This mask can be used with value types Single and Double. If you want to have an error message and constrains in numeric editor you should implement additional validation like in the sample Numeric Editor -> SL3 DataBinding Validation or set constrains using Minimum and Maximum properties. Property ValueType in XamWebMaskedEditor is always string and it could not be set to another type. XamWebMaskedEditor can be used but you have to take care the string value from the editor to be converted to the numeric type you wish.
I included some examples inthe attached file and I hope to be useful for you.
Regards,
Software Engineer in Test
Thank you very much for the detailed explanation. Your sample code works very well. There is only one thing left: How can I specify a default value in XAML? If I use the value property for a numeric editor control (ValueType="System:Double") and try to assign a value e.g. 12,1 I get the error "The new assigned value 12,1 is not of specified type:Double".
Is it not possible to assign a default value in XAML so that I have to use code behind instead?
Kind regards,
Yes, it is not possible to assign a default value in XAML. You should do this from code behind and the value has to be in the appropriate type that you use.
Hello Prakhecha,
Yes, it is possible to bind the value of XamWebNumericEditor in XAML – you should do something like:
<ig:XamWebNumericEditor x:Name=”Age” Value="{Binding Path=Age, Mode=TwoWay}" />
I hope this satisfies your question.Sincerely, Tanya
Hi,
Is it possible to BIND the Value of numeric editor in xaml(not code behind) as we do for textbox?
TextBox Text='{Binding filed_name, Mode=TwoWay}'
Ok, so I will do that in code behind.Again, thank you very much for your help.