Hi,
Is the Name property of DisplayAttribute supported?
Example:
public class Test { [Display(AutoGenerateField = false)] public long Id { get; set; } [Display(Name = "Description")] public string Desc { get; set; } }
Below is a test with a XamGrid (2010.2) on the top and a normal silverlight DataGrid on the bottom.
The header text is the property name for the xamGrid and the value given by the attribute for the normal grid.
Am I missing something?
Regards,
Julien
Currently we do not support the DataAnnotation attributes however it is on our backlog.
Hi Darrell,
what is the current state here. Can you tell if it'll be part of the next upgrade?
sprinter252
I have been trying to do this with 2011.1 but it doesn't seem to work.
But I'm creating objects to bind using System.Reflection.Emit.TypeBuilder etc. and it's possible I made a mistake. It would be nice to hear from Infragisitcs so I have some idea whether it should work and I messed up, or if it's not expected to work I can start on an alternate way.
Thanks,
Mike
MichaelSargent said:
Make sure that you have a reference to the InfragisticsSL4.Data.AnnotationsDataManager.v11.1.dll and that the AnnotationsDataManagerProvider is set to the XamGrid as described in this article - http://help.infragistics.com/Doc/Silverlight/2011.1/CLR4.0/?page=xamGrid_Data_Annotations.html.
Regards
That works. When I tried to do entirely in XAML I got a run-time error (unknown type), but if I put a reference to the assembly in the code behind (even an unused local variable) then it works fine. I suspect that the AnnotationsDataManager assembly isn't being included in the XAP file if only referenced in XAML. So I just did it in the code behind and it's working well.
Normal 0 21 false false false HR X-NONE X-NONE MicrosoftInternetExplorer4
Hi
I Have a same problem, but no solution.
I read article : http://help.infragistics.com/NetAdvantage/Silverlight/2011.1/CLR4.0/?page=xamGrid_Data_Annotations.html
And applied [DisplayFormat(DataFormatString = "{0:N}", ApplyFormatInEditMode = true)]
Atributes to my data class, but nothing happens. Then I added:
<ig:XamGrid.DataManagerProvider>
<ig:AnnotationsDataManagerProvider/>
</ig:XamGrid.DataManagerProvider>
To xamGrid xaml an then I get fallowing error:
Error 18 The tag 'AnnotationsDataManagerProvider' does not exist in XML namespace 'http://schemas.infragistics.com/xaml'.
I included reference to: System.ComponentModel.DataAnnotations.dll but it didn’t help.
How can I make xamGrid use DataAnnotations?
ok.
thx it works now.
@grabah
Check one of my posts above. You need to add a reference to InfragisticsSL4.Data.AnnotationsDataManager.v11.1.dll;