StrataFrame Forum

Store Browse Dialog Entries

http://forum.strataframe.net/Topic25173.aspx

By Aaron Young - 11/11/2009

Hi,

Is it possible to retain previous browse dialog search field entries if a browse is re-opened? For example, user opens the initial browse window, enters some search values, closes the browse window and later re-opens the browse window. Instead of starting with a cleared browse dialog, is it possible to retain the previously entered search values?

Thanks in advance,

Aaron

By Russell Scott Brown - 11/11/2009

I searched for keyword "save browse settings" and found some good suggestions but not a lot of helpful detail or examples.
By Trent L. Taylor - 11/12/2009

Yes. You will want to use the InitializeSearchFields event to set the initial search values. That is actually the purpose of this event. It is called before the BrowseDialog is shown allowing you to initialize any search fields. You will set the InitialValue property of a search field:



InitializeSearchFields Event

Me.BrowseDialog1.SearchFields(0).InitialValue = "Smith"




Then you can save off the values in the SearchValueChanged event. The purpose of this event is to give you access directly to the editor control as well as the search field element. You may need to add a test on the type of object (i.e. MaskedTextBox, Date control, etc.). But if you are entering a string value, it will be a MaskedTextBox and you would retrieve the value like this:



SearchValueChanged Event

Dim x As String = e.SourceControl.Text
By Aaron Young - 11/12/2009

Thanks guys Smile