StrataFrame Forum

BrowseDialog Incremental Search possible?

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

By Keith Chisarik - 6/7/2007

Can we set the BD so that it shows the closest matches in the results window as the user types out of the box?



If not how might I implement this?



Thanks.
By Trent L. Taylor - 6/7/2007

In version 1.6.1 we have made a LOT of changes to the BD to give you a lot more functionality and control.  One of the features is that the Infopanel provides access to the BrowseDialogForm as well as the BrowseDialog control.  The results are shown in a ListView which already has an Incremental search ability that you can take advantage of.  Just add you an InfoPanel that has the text box then manually execute the incremental search on the populated results list and there you go. Smile

Before you ask....maybe by the end of next week worst case the following week Wink

By Keith Chisarik - 6/7/2007

OK great thanks.



I was going to plumb it myself, but I can wait a week Smile
By Edhy Rijo - 6/10/2009

Trent L. Taylor (06/07/2007)
In version 1.6.1 we have made a LOT of changes to the BD to give you a lot more functionality and control. One of the features is that the Infopanel provides access to the BrowseDialogForm as well as the BrowseDialog control. The results are shown in a ListView which already has an Incremental search ability that you can take advantage of. Just add you an InfoPanel that has the text box then manually execute the incremental search on the populated results list and there you go. Smile





Hi Trent,



Is there a way to do an incremental search in the current listview control on a winform?
By Trent L. Taylor - 6/12/2009

Yes, but you will have to drop on a text box and then write the call the search yourself. There are two methods on a ListView that support this. You can call the FindNearestItem method or the FindItemWithText method. This should get you what you are looking for.
By Edhy Rijo - 6/12/2009

Thanks a lot, will start looking at those methods.
By Edhy Rijo - 6/12/2009

Hi Trent,



Once again, thanks for the heads up on this one, it was really easy to implement and here is what I did:





Private Sub StartSerialIncrementalSearch(ByVal startSerialNumber As Integer)

Dim item1 As ListViewItem = Me.lstItemsStock.FindItemWithText(startSerialNumber.ToString, True, 0)

If item1 IsNot Nothing Then

item1.Selected = True

Me.lstItemsStock.EnsureVisible(item1.Index)

Me.lstItemsStock.TopItem = item1

End If

End Sub

By Trent L. Taylor - 6/15/2009

Cool...looks good Smile
By Keith Chisarik - 7/29/2009

[b]One of the features is that the Infopanel provides access to the BrowseDialogForm as well as the BrowseDialog control.  The results are shown in a ListView which already has an Incremental search ability that you can take advantage of.  Just add you an InfoPanel that has the text box then manually execute the incremental search on the populated results list and there you go.

Did this ever make it in? Is it documented anywhere? My user wants the textbox to incrementally search the results list exactly as you described. I have the InfoPanel withthe textbox, now I am lost.

Also, how to I programatically execute the search, I found the "Search" method in the class browser but could not figure out how to use it just from that. User wants the results list prepopulated.

Thanks

By Trent L. Taylor - 7/30/2009

Actually the BrowseDialogWindowReference object is how you can get to every object within the browse window. However, I went ahead and added a property on this exposed object giving direct access to the browse results list. After that, you just call the FindTextItem method to produce an incremental search. Here is the write-up that will appear in the help, but I will do another build later today or tomorrow that will include this for you.



The BrowseDialogWindowReference has been available within the framework for a long time. However, it was a little cumbersome to get directly to the browse results list view which was the most common object that was sought after via this reference. A new property called BrowseResultsListView has been added to the exposed BrowseDialogWindowReference allowing much easier access to this list.

By Edhy Rijo - 7/30/2009

Thanks Trent, that is a very good enhancement.