﻿<?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?)  » Enforcing data type on searchfield UI in BrowseDialog</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 10 Sep 2026 05:15:28 GMT</lastBuildDate><ttl>20</ttl><item><title>Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30895.aspx</link><description>Many of my Searchfields are integers and for a lot of them I can't use a dropdown to make sure an integer is the entered result.&lt;br/&gt;&lt;br/&gt;Since the searchfield is a textbox, the user can enter an alpha string and then get an ugly error on the search&lt;br/&gt;&lt;br/&gt;How do I make sure only integers can be entered into the searchfield ?&lt;br/&gt;&lt;br/&gt;I tried this :&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[code]&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;void&lt;/span&gt;&amp;nbsp;bdExchanges_InitializeSearchFields(&lt;span style="color:blue;"&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&amp;nbsp;e)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bdExchanges.SearchFields[&lt;span style="color:#a31515;"&gt;"From_Date"&lt;/span&gt;].InitialValue&amp;nbsp;=&amp;nbsp;&lt;span style="color:#2b91af;"&gt;DateTime&lt;/span&gt;.Today.ToString();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bdExchanges.SearchFields[&lt;span style="color:#a31515;"&gt;"Thru_Date"&lt;/span&gt;].InitialValue&amp;nbsp;=&amp;nbsp;&lt;span style="color:#2b91af;"&gt;DateTime&lt;/span&gt;.Today.ToString();&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:green;"&gt;//&amp;nbsp;this&amp;nbsp;searchfield&amp;nbsp;has&amp;nbsp;override&amp;nbsp;data&amp;nbsp;type&amp;nbsp;set&amp;nbsp;to&amp;nbsp;Int32&amp;nbsp;in&amp;nbsp;BD&amp;nbsp;Searchfields&amp;nbsp;properties&amp;nbsp;UI&lt;/span&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;bdExchanges.SearchFields[&lt;span style="color:#a31515;"&gt;"ReutersExchangeID"&lt;/span&gt;].FieldType.Equals(&lt;span style="color:#2b91af;"&gt;SqlDbType&lt;/span&gt;.Int);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/pre&gt;&lt;span&gt;[/code]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;but that does not seem to be the answer?&lt;br/&gt;&lt;br/&gt;Eddy, you can be my hero again ( and this time I'll pay attention &lt;span&gt;:D&lt;/span&gt; )</description><pubDate>Thu, 09 Feb 2012 10:33:36 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30900.aspx</link><description>No Problem Charles, we are always up to the task, so let us know how it goes. &lt;span&gt;:P&lt;/span&gt;</description><pubDate>Thu, 09 Feb 2012 10:33:36 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30899.aspx</link><description>Wow, Eddy, you're right - I am really starting to sound like Marsha, so I will quote her directly &lt;br/&gt;&lt;br/&gt;&lt;span&gt;[quote]&lt;br/&gt;&lt;/span&gt;&lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl02_lblFullMessage"&gt;OK - I CAN explain it. It is the loose nut behind the keyboard &lt;img style="vertical-align: middle;" src="Skins/Classic/Images/EmotIcons/Smile.gif" alt="Smile"&gt;&lt;br/&gt;&lt;br/&gt;problem solved.&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&lt;br/&gt;[/quote]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;I didn't have advanced properties showing and didn't realize I was making my date fields = rather than &amp;lt;= and &amp;gt;= &lt;br/&gt;&lt;br/&gt;DOH!&lt;br/&gt;&lt;br/&gt;I think a mask is going to work ( if only to hide my embarrassed face )</description><pubDate>Thu, 09 Feb 2012 10:16:51 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30898.aspx</link><description>I guess my mask idea wasn't a good one.&lt;br/&gt;&lt;br/&gt;For the Searchfields that will search on integers I put 000000 in the FieldMask and left it at ExcludePromptsAndLiterals&lt;br/&gt;&lt;br/&gt;At run time I get six underscores in that box and they are limited to 0-9 - Great&lt;br/&gt;&lt;br/&gt;But my search on Name begins with - not touching the integer searchfields - gets nothing. so I think the search is using the integers in the search.&lt;br/&gt;&lt;br/&gt;There has to be a better way to do this.&amp;nbsp; Is there way to use InitializeSearchFields event as I outlined at the beginning of the thread?&lt;br/&gt;&lt;br/&gt;I cannot let the user accidently enter alpha characters in these fields.&lt;br/&gt;&lt;br/&gt;Second part of the question - how do I see the where clause that the browse dialog built ?&amp;nbsp; </description><pubDate>Thu, 09 Feb 2012 10:01:27 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30897.aspx</link><description>[quote][b]Charles R Hankey (2/9/2012)[/b][hr]Just realized there is a mask property in the UI ( Duh ! )[/quote]&lt;br/&gt;Charles, you are starting to sound like Marcia &lt;span&gt;:blush:&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;[quote][b]Charles R Hankey (2/9/2012)[/b][hr]The parts of the Browse Dialog that are developed are so VERY cool it makes me really yearn for major development on this aspect of the product.&amp;nbsp; [/quote]&lt;br/&gt;Well we are all waiting for those major changes in SF 2.0 &lt;span&gt;:D&lt;/span&gt;&amp;nbsp; I am lucky I get to use SF almost everyday and for many challenges, I always get surprised of what I can do with the framework.&amp;nbsp; I totally love the flexibility of the business objects, been able to create then on the spot, filter, seek, manipulate broken rules, etc. but still I can't wait for SF 2.0.</description><pubDate>Thu, 09 Feb 2012 09:09:46 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Enforcing data type on searchfield UI in BrowseDialog</title><link>http://forum.strataframe.net/FindPost30896.aspx</link><description>Just realized there is a mask property in the UI ( Duh ! )&lt;br/&gt;&lt;br/&gt;I think that is going to give me what I need.&amp;nbsp; It also answers how to I shorten those ugly wide textboxes etc. &lt;br/&gt;&lt;br/&gt;The parts of the Browse Dialog that are developed are so VERY cool it makes me really yearn for major development on this aspect of the product.&amp;nbsp; </description><pubDate>Thu, 09 Feb 2012 08:54:21 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item></channel></rss>