DataAnnotations / DisplayFormat

6 posts, 0 answers
  1. Troy Roberson
    Troy Roberson avatar
    7 posts
    Member since:
    May 2010

    Posted 28 Jun 2010 Link to this post

    We're using the DataAnnotations in several of our classes that populate the Gridview, and DisplayAttribute works fine, but trying to use [DisplayFormat(DataFormatString = "{0:d}")] for a datetime doesn't seem to work.  The time always gets carried over into the Grid.

    Is this currently supported in the GridView?  Or am I doing something wrong?

    Troy
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Jun 2010 Link to this post

    Hello Troy Roberson,

    The DisplayFormatAttribute is not yet supported by RadGridView but we will try to include it in a future release. At the moment you can use the DataFormatString property of our GridViewDataColumn to format the data that is displayed.

    Thank you for your feedback. Your Telerik points have been updated.


    All the best,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Tomas
    Tomas avatar
    92 posts
    Member since:
    Jun 2010

    Posted 29 Jun 2010 Link to this post

    Do you have a more precise schedule for when you plan to implement this (and other DataAnnotation support as well)?
    We are also using DataAnnotations on our classes and this is a very important feature for us.

    To insert DataFormatString on every RadGridView where you use a DateTime field doesn't feel like a very feasible solution when you could have it specified in just one place and have the controls automatically pick this up.

    Another DataAnnotation we've got problems with is [Editable(false, AllowInitialValue=true)] which in the RadGridView has the behaviour that it allows still allows you to edit the field but when you're done editing you get a validation error telling you the field is readonly. Here again if I want the column to be readonly I'll have to specify it in xaml.

    Tomas

  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 29 Jun 2010 Link to this post

    Hello Tomas,

    We won't be able to include support for those attributes in our next release (Q2) but we will do our best to improve our handling of such attributes with the service pack releases after Q2.


    Kind regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Sebastian Talamoni
    Sebastian Talamoni avatar
    32 posts
    Member since:
    Mar 2008

    Posted 08 Sep 2010 Link to this post

    Milan,

    I was also relying on this attribute...

    It´s a pitty that it´s not yet supported in Q2 SP1.
    Are there any news about this feature?

    For some simple ViewModels we use the same View + Grid with ItemSource={Bindinding Items} and using autoGenerateColumns=true, so i don't think I can use that workaround mentioned inside this thread.. 

    Thanks in advance,
    Sebastian Talamoni
  7. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 13 Sep 2010 Link to this post

    Hi Sebastian Talamoni,

    You can download our latest internal build in order to get support for DisplayFormatAttribute and ReadOnlyAttribute. In a week or two we will release SP2 which will make support for these attributes official.
    Let me know how it works on your end.

    Sincerely yours,
    Nedyalko Nikolov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner