c1FlexGrid Filter Column

Posted by: philippe.berhin on 22 June 2020, 8:40 pm EST

  • Posted 22 June 2020, 8:40 pm EST - Updated 3 October 2022, 2:42 pm EST

    Hi

    It seems that the filter column (Flexgrid) doesn’t work (and has has never worked for me). version 4.5.2 20201.1.417

    a simple example below. If I apply the filter Show Date greater than Jun 19, No filter is applied.

    On top having the possibility to selext a time range will be

  • Posted 23 June 2020, 6:09 pm EST

    Hi Philippe,

    I think this works. See the sample attached to https://www.grapecity.com/forums/winforms-edition/c1flexgrid-custom-columnfi - though it is about extending the filter, it also shows the default datefilter behavour.

    Do you have some special setting for the column, e.g. date format? What is the data type?

    Best regards

    Wolfgang

  • Posted 23 June 2020, 7:41 pm EST - Updated 3 October 2022, 2:42 pm EST

    Hello Philippe,

    We too can not replicate the issue at our end as shown in the attached GIF.

    If you are doing something else then please let us know and modify the sample accordingly,

    @Wolfgang, thank you for your observations.

    Regards,

    Prabhat Sharma.

    FlexGridColumnFilter.zip

  • Posted 23 June 2020, 9:44 pm EST - Updated 3 October 2022, 2:42 pm EST

    Hi

    I tried the solution provided by Wolfgang (many Thanks) and if not perfect, at least I have some filtering.

    The column has the Datetime type but contains not only a date but also a time. (up to ms in many cases). In the screen shot below, I ask to get data > Feb 7 and less than Feb 9. I expect all records with a datetime stamp of Feb 8 but get Feb 7 and 8.

    PS : Column filtering on Day works fine.

    I think I will add a drop box for days (1-31) instead of day name

    I think that as soon as the time is > 00:00:00, it is considered as being >

    So the filter only target the date but ignore the time.

    Ideally, I need to have a calendar to select the date AND a time picker to select the time range.

    In my applications, more than 99 % of date have time and I need to be able to filter on both. The current filter is useless for me

    Hope this clarify

  • Posted 23 June 2020, 9:47 pm EST - Updated 3 October 2022, 2:42 pm EST

    Sorry wrong screen shot

  • Posted 23 June 2020, 11:16 pm EST

    Hi Philippe,

    you are right, the “greater than” filter probably starts with “00:00”, and the “less than” filter hopefully ends at “23:59” - the filter probably just checks the “DateTime.Date” value.

    If you set the filter to “greater von 8 july”, you should get the requested result.

    Best regards

    Wolfgang

  • Posted 24 June 2020, 12:10 am EST

    I tried this and other combination but it doesn’t work.

    All fine as long as you deal with Date only

  • Posted 24 June 2020, 5:59 pm EST

    Hi Philippe,

    We are discussing this with the developers and will let you know once we get the update on this.

    [Internal Tracking ID: 442489]



    Regards,

    Prabhat Sharma.

  • Posted 24 June 2020, 7:15 pm EST - Updated 3 October 2022, 2:42 pm EST

    Thanks

    in between I added a custom filter displaying the available days in the current view allowing one or multiple days selection (but time is ignored)

  • Posted 25 June 2020, 6:20 pm EST

    Hi Philippe,

    Sorry, but it is not clear just by your given screenshot that what you want to convey.

    Can you please share the screenshot of the output after filtering and also modify the last attached sample implementing your custom filter so that we can replicate the same issue at our end and assist you accordingly.

    Note: JFYI, we have asked the developers to add a feature to include time field too in the default datetime filter dialog.

    Regards,

    Prabhat Sharma.

  • Posted 25 June 2020, 8:26 pm EST - Updated 3 October 2022, 2:42 pm EST

    Hi,

    Having the time field added is the expected solution. thanks for passing the request.

    The first screenshot shows the current default filter applied on a grid having data for feb 3 - 7 with the default filter set to Feb 5. As the time field is set, filter return 0 rows

    The second shows the custom filter I used for filtering on one or more days

    No time filter but at least I can filter on date

    The Code used is attached

    You just need a grid with a DateTime column (that included time other than 00:00:00

    When you flex is defined, assign the custom filter

    Custom filter is applied if fomat is like dd-MMM-yyyy …

    AssignFilterColumn(flex)

    private void AssignFilterColumn(C1FlexGrid flex)

    {

    for (int index = flex.Cols.Fixed;index < flex.Cols.Count;index++)

    {

    if (flex.Cols[index].Format.Contains(“dd-MMM-yyyy”)) flex.Cols[index].Filter =

    new FlexGridColumnFilterDatum();

    }

    }

    Customfilter is attached

    FlexGridColumnFilterEditorDatum.zip

  • Posted 28 June 2020, 10:24 pm EST

    Hi Philippe,

    Thank you for the attached files.

    The result of the default condition filter is blank because the default time is 12:00:00 in the condition filter and there must be no value with time 12:00:00 in your cells.

    Including the time value will definitely solve your issue.

    In the meantime, you can use the condition filter using >= and <= conditions or continue using your custom filter to get the desired value.

    We will let you know once we get any update on this from the devs end.

    Regards,

    Prabhat Sharma.

  • Posted 29 June 2020, 6:13 pm EST - Updated 3 October 2022, 2:42 pm EST

    Hi Prabhat

    I

    The >= works but if you want to have a filter on 28 and 29 of June,

    you need to specify >= 28 and < 30

    using >= 28 and <= 29 only give the 28.

    Note also that part of the condition is truncated

  • Posted 29 June 2020, 8:28 pm EST

    Hello,

    >>The >= works but if you want to have a filter on 28 and 29 of June,

    you need to specify >= 28 and < 30

    using >= 28 and <= 29 only give the 28.

    This is because as I said earlier that it treated the default time as 12:00:00 (00:00:00) which is just the start of the day so if you want the date 28 and 29 then you need to use the filter like >= 28 and < 30.

    >>Note also that part of the condition is truncated



    I too can observe this and forward it to the devs to get it fixed.

    Regards,

    Prabhat Sharma.

  • Posted 8 August 2020, 7:04 pm EST

    hi

    2020v2 is out but time has not been added to the filter column for datetime.

    do you know when it will become available.?

    Thanks

  • Posted 9 August 2020, 1:12 pm EST

    Hello,

    We are getting in touch with the developers for the updates and will let you know soon.

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels