http://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-filter-date-value
But my grid is using auto-generated columns. How do I get this work when I'm not declaring each individual column?
5 Answers, 1 is accepted
As your columns are auto generated, you could subscribe for RadGridView's AutoGeneratingColumn event and apply any additional setting needed.
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

I even have a check for the col data type so that dates are formatted to display the date only. But I'm unsure how to get the FieldName.Date into the FilterMemberPath so that it filters on Date only.
You need to set the FilterMemberPath similarly to how you do so in xaml. Does it not work for you?
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Here is a sample of my code, which is located in the AutoGeneratingColumn event handler:
var col = e.Column
as
GridViewDataColumn;
if
(col.DataType ==
typeof
(
decimal
?))
col.DataFormatString =
"{0:F4}"
;
else
if
(col.DataType ==
typeof
(DateTime))
{
col.DataFormatString =
"{0:d}"
;
//add code here to filter on Date portion of DateTime
}
You can set the FilterMemberPath based on the corresponding DataMemberBinding path.
For example, having your existing code you should add a line like:
col.FilterMemberPath = col.DataMemberBinding.Path.Path +
".Date"
;
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I have similar situation. My problem is that not all cells have a date value (it can be null/dbnull).
Using col.DataMemberBinding.Path.Path +
".Date"
worked for me only partially, that is only if all cells have a value.
Any suggestions please?
Hello Ghefar,
I provided an answer to the ticket that you opened regarding this case.
Generally, the FilterMemberPath property is the way to go when a property's value, different from the one set to the DataMemberBinding, is needed for the filtering operations. Since the underlying type is a nullable DateTime, the FilterMemberPath property should look as follows when the columns are auto-generated:
private void RadGridView_AutoGeneratingColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)
{
//The current e.Column is bound to a nullable DateTime
GridViewDataColumn column = (GridViewDataColumn)e.Column;
//The FilterMemberPath property should be set to "property name + .Value.Date"
column.FilterMemberPath = column.DataMemberBinding.Path.Path + ".Value.Date";
}
When the column is manually defined, you could set it as follows:
<telerik:GridViewDataColumn DataMemberBinding="{Binding MyNullableDateTimeProperty}" FilterMemberPath="MyNullableDateTimeProperty.Value.Date"/>
With this being said, I hope the provided information will be of help to you.