You cannot have a useless finisher with a ready-made control. What for? It is supported by DateTime, which is not null.
You can disable it using another control or leave it disabled until the user presses (bad UX for keyboard enthusiasts, for example myself), or find or create (!) That uses a Nullable<DateTime> .
Edit:
In response to your comment, yes, you can do it; in fact, I did it.
- use fields or private properties to store the dates 'from' and 'to' instead of reading them from dtp and set their default values ββto min and max
- use a boolean flag indicating when you control the dtp value in the code and set the flag value to false in the dtp
ValueChanged event - in the form load event, set the flag to true and the dtp value today
- also in the
ValueChanged event ValueChanged set the from and to fields to dtps values ββ(you must set both parameters when dtp changes, because the user will see another one set to date, but the search value will still be minimum or maximum).
The problem with this is that as soon as the user has changed the date selection, she cannot easily return to "all dates". In addition, the user cannot select βtoday onlyβ without changing one of the dates and then changing it.
I believe that the best solution for you is the checkbox "search by date range", which either allows you to disable two dtps, or display hidden dtps. Then you search from min to max if the checkbox is unchecked and when the checkbox is checked, you use two dtp dates no matter what they represent. Remember to deal with to and from out of order, which can be done in several ways.
source share