I've read the documentation that explains how to filter on the Date value only from here:
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?
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
0
Hi,
As your columns are auto generated, you could subscribe for RadGridView's AutoGeneratingColumn event and apply any additional setting needed.
Regards,
Dimitrina
Telerik
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.
0
Rayne
Top achievements
Rank 1
answered on 10 Feb 2015, 01:55 PM
I'm already subscribed to that event for some other stuff.
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.
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.
0
Hi,
You need to set the FilterMemberPath similarly to how you do so in xaml. Does it not work for you?
Regards,
Dimitrina
Telerik
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.
0
Rayne
Top achievements
Rank 1
answered on 12 Feb 2015, 07:46 PM
No. I haven't gotten it to work. I'm a bit stuck on how to identify the correct piece of data so that I can assign it to FilterMemberPath.
Here is a sample of my code, which is located in the AutoGeneratingColumn event handler:
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
}
0
Hi,
You can set the FilterMemberPath based on the corresponding DataMemberBinding path.
For example, having your existing code you should add a line like:
Regards,
Dimitrina
Telerik
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.