This is a migrated thread and some comments may be shown as answers.

Search as you type with nullable date

1 Answer 22 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Roberto
Top achievements
Rank 2
Roberto asked on 22 May 2010, 09:55 AM
Hi,
I have a gridview with 2 or 3 string column and one date column, EventDate, that is of type "System.Nullable<DateTime>". When I do a search with CustomFilterDescriptor (I follow your example), the gridview shows the rows that match my search string, but also the rows that have EventDate null. I need that the gridview shows only the rows that cointains the searching string.
I tried to use DummyConverter with EventDate column:

public class DummyConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DateTime? dt = (DateTime?)value;

            if (dt.HasValue)
                return String.Format("{0:d}", dt);
            else
                return "-";
        }
        // ...
}
but it does'n work.
Thank in advantage for your help.
Roberto

1 Answer, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 25 May 2010, 08:41 AM
Hello Roberto,

Please check this blog post which illustrates how this can be implemented.

Best wishes,
Stefan Dobrev
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.
Tags
GridView
Asked by
Roberto
Top achievements
Rank 2
Answers by
Stefan Dobrev
Telerik team
Share this question
or