Completed
Last Updated: 04 Jun 2019 10:30 by ADMIN
Release Q2 2014
ADMIN
Georgi I. Georgiev
Created on: 26 Nov 2013 11:29
Category: MultiColumnCombo
Type: Bug Report
1
FIX. RadMultiColumnComboBox - filtering by DateTime column does not work
To reproduce:

Add a RadMultiColumnComboBox and add a DateTime column. Add a filter descriptor for the column and set the autofilter property to true. Type in the textbox and you will see abnormal behavior.

Workaround:
public class DTConverter : TypeConverter
{
    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
        DateTime dt;
        if (DateTime.TryParse(value.ToString(), out dt))
        {
            return dt;
        }

        return DateTime.MinValue;
    }

    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
        if (sourceType == typeof(string) || sourceType == typeof(DateTime))
        {
            return true;
        }

        return base.CanConvertFrom(context, sourceType);
    }
}

(this.multiColumnComboBox.MultiColumnComboBoxElement.Columns["SaleDate"] as GridViewDateTimeColumn).FilteringMode = GridViewTimeFilteringMode.Date;
(this.multiColumnComboBox.MultiColumnComboBoxElement.Columns["SaleDate"] as GridViewDateTimeColumn).DataTypeConverter = new DTConverter();
Telerik.WinControls.Data.FilterDescriptor oFilter = new Telerik.WinControls.Data.FilterDescriptor();
oFilter.PropertyName = this.multiColumnComboBox.DisplayMember;
oFilter.Operator = Telerik.WinControls.Data.FilterOperator.IsGreaterThanOrEqualTo;
this.multiColumnComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(oFilter);
1 comment
ADMIN
Dimitar
Posted on: 04 Jun 2019 10:30
Hello,

The issue is fixed in Telerik UI for WinForms Q2 2014 with the addition of the RadGridDateTimeConverter class which is working with the GridViewDateTimeColumn.
ADD. RadGridView - added DateTimeMode property for GridViewDateTimeColumn

Regards,
Dimitar