Browse Dialog and Searching Event


Author
Message
Robin J Giltner
Robin J Giltner
StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)
Group: Forum Members
Posts: 105, Visits: 650
Is there a trick to having the Searching Event raised on a subclassed BrowseDialog?  I have several subclassed BD's and I can't seem to ever get the Searching Event to fire off.  In my one non-subclassed BD, the event gets raised fine and I can go about my business, but on my others it never seems to.

I've tried putting the event handler on the form the BD is on, as well as in the BD designer with no luck.  I'm pretty sure I'm missing something easy, but I can't for the life of me figure this one out.

Thanks

Robin Giltner

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, since you are subclassing the BD, just override the OnSearching method.  This will give you ultimate control and you can place your code before or after the event.

Protected Overrides Sub OnSearching(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchingEventArgs)
        MyBase.OnSearching(e)
        '-- Add your code
    End Sub

Robin J Giltner
Robin J Giltner
StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)
Group: Forum Members
Posts: 105, Visits: 650
And here I can test the input on the search fields and strip out what shouldn't be there?  Users keep wanting to put text into a numeric field in the BrowseDialog.

Thanks

Robin Giltner

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yeah, the OnSearching method is the method that is invoked to raise the Searching event.  So this is the same as handling the event, but you actually have more control.
Robin J Giltner
Robin J Giltner
StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)
Group: Forum Members
Posts: 105, Visits: 650
Well, I've messed with this as long as I think I can before my head explodes.

I went back and made a simple project with one BusinessObject and one BrowseDialog to the Strataframe Sample, and added some code to the BrowseDialog1.Searching Event to see if I could get it to do something, with no luck.

I'm sure I am missing something here, but can't for the life of me figure this one out.

Any chance you could take a look and point me in the right direction?

Thanks

Robin Giltner

Attachments
BOSearching.zip (67 views, 734.00 KB)
Robin J Giltner
Robin J Giltner
StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)StrataFrame User (125 reputation)
Group: Forum Members
Posts: 105, Visits: 650
Doh, yeah... think I have it.  There searching event is getting fired off, but only when the whereclause gets built without errors, as the clause has to be built before you can interact with the values inside it.  That only makes a huge amount of sense. Crazy

So it looks like I'll have to try something else to filter the search criteria the user puts into the searchfield.  It keeps failing trying to convert a string to a double on the BuildWhereElement clause.  I guess I can use the Mask property on the tetbox to limit input, and see how that goes.

Thanks

Robin Giltner

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Aye, a mask on the input would be your best bet.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search