Display short date with working filters

5 posts, 0 answers
  1. Minh
    Minh avatar
    43 posts
    Member since:
    May 2014

    Posted 03 Jul 2015 Link to this post

    At the moment if you only want to display the date you set the column to be string and you set x.Date.ToShortDateString() and that works perfectly for showing short dates but the sort then breaks because the values are "strings"

     

    for example it'll recognize 10/1/2015 > 1/2/2015 If the universal time setting on the machine is set to DD/MM/YYYY.

     

    Are there ways to display short date string and retain the filters to work correct? 

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Jul 2015 Link to this post

    Hi,

    You can apply a converter to the binding instead. Please keep in mind the filtering will be performed based on the property specified as DataMemberBinding. You can also refer to the documentation on Filtering.

    Regards,
    Dimitrina
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. Minh
    Minh avatar
    43 posts
    Member since:
    May 2014

    Posted 06 Jul 2015 in reply to Dimitrina Link to this post

    Hi,

    My grid at the moment is autogenerate columns, how would a converter be implemented if I don't specify the column? 

  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Jul 2015 Link to this post

    Hello,

    You can subscribe for the AutoGeneratingColumn event and then work with e.Column.

    Regards,
    Dimitrina
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Minh
    Minh avatar
    43 posts
    Member since:
    May 2014

    Posted 06 Jul 2015 in reply to Dimitrina Link to this post

    Hi,

    That sounds plausible, I tried the code from http://www.telerik.com/forums/codebehind-binding-with-converter-in-c but it seems like an old post. May I ask how do I set the DataMemberBinding.

Back to Top