How to filter date

Hi,


I studied the filter logic provided with your Winforms demo and have tweaked it form for my project. But I am stuck. I want filter a date column between condition but it does seem to yielding desired result. Please it that feature supported? Please find code below.  


        public bool FilerActivityRecords(object o)

        {

            //double res;

            //bool checkNumeric = double.TryParse(ActivityFilterText, out res);

            var item = o as StockManagementListView;

            if (item != null && minDate.Equals("") && maxDate.Equals(""))

            {

                return true;

            }

            else

            {

                DateTime dt1 = GeneralClass.GetDateFromString(minDate);

                DateTime dt2 = GeneralClass.GetDateFromString(maxDate);


                if (item != null)

                {

                    if (item.StockManaDate >= dt1 || item.StockManaDate <= dt2)

                        return true;


                    return false;

                }

            }


            return false;

        }




Best regards

Paul Aziz


1 Reply

BT Balamurugan Thirumalaikumar Syncfusion Team September 22, 2021 10:42 AM UTC

Hi Paul, 

Thank you for interesting in Syncfusion products. 

We have checked your query at our end “How to filter date” at our end. In order to filter the DateTime column between two dates in SfDataGrid, we have prepared the simple for your reference. You can refer the following sample and UG documentation. 



Please let us know we misunderstood your query or if you would require any other assistance. we will be always happy to assist you. 

Thanks & Regards, 
Balamurugan Thirumalaikumar  


Loader.
Up arrow icon