﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » How to have datetime searchfields checked by default in Browse Dialog</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 09 Sep 2026 14:45:56 GMT</lastBuildDate><ttl>20</ttl><item><title>How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30852.aspx</link><description>I have 2 searchfields in my Browsedialog and have the defaults set for &amp;gt;= and &amp;lt;= Datetime.Today in their properties.&lt;br/&gt;&lt;br/&gt;How do I make sure they are checked by default when the user brings up the BD?&amp;nbsp; &lt;br/&gt;&lt;br/&gt;Thanks</description><pubDate>Mon, 06 Feb 2012 11:46:09 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30884.aspx</link><description>[quote][b]Charles R Hankey (2/6/2012)[/b][hr]&lt;font style="color: rgb(255, 0, 0);" size="4"&gt;YOU ARE MY HERO !&lt;/font&gt; This did the trick!...[/quote]&lt;br/&gt;Hmmm, I could have been your hero since 2/3/2012 &lt;span&gt;:P&lt;/span&gt;&amp;nbsp; Just kidding Charles, I am glad you pass these issues and your application is looking good again.&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[quote]My approach since working with frameworks is to &lt;span style="font-style: italic; font-weight: bold;"&gt;work with the framework, not against it!!!!&lt;/span&gt;[/quote]&lt;/span&gt;</description><pubDate>Mon, 06 Feb 2012 11:46:09 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30883.aspx</link><description>&lt;font style="color: rgb(255, 0, 0);" size="4"&gt;YOU ARE MY HERO !&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;This did the trick!&amp;nbsp; I had the date set in the property sheet and incorrectly assumed it was setting the date in the control . ( suspect it wasn't doing anything )&lt;br/&gt;&lt;br/&gt;But this does exactly what I need and is GREATLY appreciate !&lt;br/&gt;&lt;br/&gt;Thanks again</description><pubDate>Mon, 06 Feb 2012 11:32:25 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30882.aspx</link><description>Hi Charles,&lt;br/&gt;&lt;br/&gt;[quote][b]Charles R Hankey (2/6/2012)[/b][hr]I must not be explaining the problem very well.[/quote]&lt;br/&gt;&lt;br/&gt;I believe you are under some pressure and must not be reading my responses clearly &lt;span&gt;:D&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;If you set the default value of the 2 date fields in the BD InitializeSearchFields() event, you will get the result you want as shown in the image below.&lt;br/&gt;&lt;span&gt;[codesnippet]&lt;br/&gt;&lt;/span&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;Private&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&amp;nbsp;ServiceCallsBrowserDialog_InitializeSearchFields(sender&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;System.&lt;span style="color:#2b91af;"&gt;Object&lt;/span&gt;,&amp;nbsp;e&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;System.&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;)&amp;nbsp;&lt;span style="color:blue;"&gt;Handles&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;MyBase&lt;/span&gt;.InitializeSearchFields&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Me&lt;/span&gt;.SearchFields(&lt;span style="color:#a31515;"&gt;"CallDateFrom"&lt;/span&gt;).InitialValue&amp;nbsp;=&amp;nbsp;Now.Date&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Me&lt;/span&gt;.SearchFields(&lt;span style="color:#a31515;"&gt;"CallDateto"&lt;/span&gt;).InitialValue&amp;nbsp;=&amp;nbsp;Now.Date&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;span&gt;[/codesnippet]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/1b5f3d8f-60b3-4096-bbe0-7423.png" alt="http://forum.strataframe.net/Uploads/Images/1b5f3d8f-60b3-4096-bbe0-7423.png" /&gt;&lt;br/&gt;Enjoy!!!&amp;nbsp; &lt;span&gt;:cool:&lt;/span&gt;&lt;span&gt;&lt;/span&gt;</description><pubDate>Mon, 06 Feb 2012 11:12:52 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30881.aspx</link><description>I must not be explaining the problem very well.&amp;nbsp; In a datetime picker as used by the BD, the initialvalue - which can be set in the properties as design time - is a datetime.&amp;nbsp; What I want to change is the checkmark that says "use this datetime as part of the search criteria."&amp;nbsp; By default, if the user does not check it, it will not be used.&amp;nbsp; This is not the behavior I want.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;I haven't heard back from Trent so I think I'm on my own on this one.</description><pubDate>Mon, 06 Feb 2012 10:39:45 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30866.aspx</link><description>Hi Charles,&lt;br/&gt;&lt;br/&gt;Handle the BD.InitializeSearchFields event and add your default values to the 2 fields in the BD.&amp;nbsp; Here is a sample from one of my projects:&lt;br/&gt;&lt;span&gt;[codesnippet]&lt;br/&gt;&lt;/span&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;Private&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&amp;nbsp;FirstUseImportBrowseDialog_InitializeSearchFields(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;sender&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;System.&lt;span style="color:#2b91af;"&gt;Object&lt;/span&gt;,&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;e&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;System.&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;)&amp;nbsp;&lt;span style="color:blue;"&gt;Handles&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;MyBase&lt;/span&gt;.InitializeSearchFields&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Me&lt;/span&gt;.SearchFields(&lt;span style="color:#a31515;"&gt;"TransactionType"&lt;/span&gt;).InitialValue&amp;nbsp;=&amp;nbsp;Enumerations.&lt;span style="color:#2b91af;"&gt;TransactionType&lt;/span&gt;.FirstUseImport&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;span&gt;[/codesnippet]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;In above sample, the "TransactionType" field is of type enumeration, so in your case you may need to convert the date to string.</description><pubDate>Fri, 03 Feb 2012 16:40:58 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30863.aspx</link><description>I looked at the BD in the IniitializeSearchFields event but don't see anything tweakable there.&amp;nbsp; Can't see a controls collection or where we might have access to anything on the BD form after its components are initialized ( my favorite enhancemet request to BD is to decouple interface from data logic and give access to the browse dialog UI, even to completely designing the form and just bindiing to a collection of search fields )&lt;br/&gt;&lt;br/&gt;Looks like that datepicker with the checkbox isn't touchable from the outside world.&lt;br/&gt;&lt;br/&gt;Hope you have a trick up your sleeve on this one as default for my users is to have those boxes always checked but they still want to be able to uncheck them so without some access I'm going to need outside data input to decide on which view etc BD is going to use and build stuff about those two date fields into separate sps ... well, you get the idea.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;( solved my BD / Extra column problem using my TVP trick as posted in User Contributed etc.&amp;nbsp; Works great.&amp;nbsp; )</description><pubDate>Fri, 03 Feb 2012 12:48:24 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30858.aspx</link><description>I'm sorry, I was reading several posts and once and thought we were talking about a boolean.&amp;nbsp; Just a sec while I look at something.</description><pubDate>Fri, 03 Feb 2012 09:36:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30856.aspx</link><description>&lt;img src="http://forum.strataframe.net/Uploads/Images/7dc97c2f-1f47-4a2e-a223-d900.jpg"/&gt;&amp;nbsp; &lt;img src="http://forum.strataframe.net/Uploads/Images/b7c3b36c-9ea1-4bca-a0da-bec3.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;I want the two datetime pickers checked by default so unless the user says otherwise they are part of the criteria.&amp;nbsp; Just tested and putting true in the intitial value has no effect</description><pubDate>Fri, 03 Feb 2012 09:31:30 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: How to have datetime searchfields checked by default in Browse Dialog</title><link>http://forum.strataframe.net/FindPost30853.aspx</link><description>Set the InitialValue in the search field.&amp;nbsp; Another choice is to use an Enum, which you can still set the default value as well.&amp;nbsp; Just make the values of the enum line up with 0 or 1 for True and False.&amp;nbsp; I think that there is a sample of this somewhere in StrataFlix...I haven't look in a while.&amp;nbsp; But I KNOW that I have talked about this before :D</description><pubDate>Fri, 03 Feb 2012 09:19:22 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>