how can I get date column filter as excel?
hi
I use a data filter in my sfdatagrid but in the date column I get the dates day by day, is there any method to get the date by months and years, and days as Excel filter?
note: I know that there is an advanced filter but it's not appropriate for me like the Excel filtering method.
thanks
SIGN IN To post a reply.
7 Replies
1 reply marked as answer
MA
Mohanram Anbukkarasu
Syncfusion Team
March 24, 2021 01:20 PM UTC
Hi Mohamad,
Thanks for contacting Syncfusion products.
We are little unclear with the requirement. Can you please provide more details about your requirement with image illustration. It will be more helpful for us to check for the possibilities and to provide a prompt solution.
Regards,
Mohanram A.
MO
Mohamad
March 24, 2021 11:41 PM UTC
thanks for your reply
Attachment: Inkedqwqw_LI_9715abdf.zip
I want to group the dates in the filter menu by the months and the year as to how the attachment is explained.
Attachment: Inkedqwqw_LI_9715abdf.zip
MA
Mohanram Anbukkarasu
Syncfusion Team
March 25, 2021 02:38 PM UTC
Hi Mohamad,
Thanks for the update.
SfDataGrid doesn’t have direct support to achieve this requirement. We are currently checking the possibilities to achieve this by any workaround. We will update with further details on March 29, 2021. We appreciate your patience until then.
Regards,
Mohanram A.
MA
Mohanram Anbukkarasu
Syncfusion Team
March 29, 2021 01:43 PM UTC
Hi Mohamad,
We regret for the inconvenience.
We are still working on checking the possibilities to achieve this. We will update with further details on March 31, 2021. We appreciate your patience and understanding.
Regards,
Mohanram A.
MA
Mohanram Anbukkarasu
Syncfusion Team
March 31, 2021 09:55 AM UTC
Hi Mohamad,
Thanks for your patience.
We have checked the possibilities to achieve your requirement in our end. As we mentioned in our previous update, SfDataGrid doesn’t have any direct support to achieve this. However we can group the date values displayed in the Filter popup only based on the year value by using the grouping support in SfListView (SfListView is used to display the check box items in the Filter Popup). Please refer the below given code example.
Code example :
|
this.sfDataGrid1.FilterPopupShown += SfDataGrid1_FilterPopupShown;
private void SfDataGrid1_FilterPopupShown(object sender, Syncfusion.WinForms.DataGrid.Events.FilterPopupShownEventArgs e)
{
if (e.Column.MappingName == "OrderDate")
{
e.Control.CheckListBox.View.GroupDescriptors.Add(new GroupDescriptor()
{
PropertyName = "ActualValue",
KeySelector = (object obj1) =>
{
var item = (obj1 as FilterElement);
var dateValue = (DateTime)item.ActualValue;
return dateValue.Year.ToString();
}
});
e.Control.CheckListBox.CollapseAllGroups();
}
} |
Sample link : https://www.syncfusion.com/downloads/support/forum/163802/ze/SfDataGrid_DateColumnFilter1712133410
Please let us know if you require any other assistance from us.
Regards,
Mohanram A.
Marked as answer
PE
Peter
July 14, 2022 07:33 AM UTC
Hi While the above solution helps,
one must untick each item indivually which is not ideal.
is this feature on a build list ?
regards
Peter
VS
Vijayarasan Sivanandham
Syncfusion Team
July 15, 2022 05:38 PM UTC
Hi Peter,
We regret to inform you that the scenario you mentioned does not apply to the
DataGrid FilterPopup. Therefore, we were unable to log the feature for the
same.
Could you please confirm how you group the filter value of
the FilterPopup in DataGrid?
Regards,
Vijayarasan S
SIGN IN To post a reply.
- 7 Replies
- 4 Participants
- Marked answer
-
MO Mohamad
- Mar 23, 2021 08:54 PM UTC
- Jul 15, 2022 05:38 PM UTC