Visual Basic Development Bookmark and Share   
 Home > Visual Basic Power Packs > DataRepeater: filter pictures by <filename>
 

DataRepeater: filter pictures by <filename>

I have datarepeater with 1 picturebox control which on form load I would like to fill with images (*.jpg, *.bmp, *.tiff, *.png) found in my pictures.

I have textbox1 used to pass a searchstring to the filter.

Once loaded I would like to filter the pictures in the datarepeater by filename
Code:
Me.DataRepeater1.Filter = String.Format("[File Name] LIKE '%{0}%'", Me.TextBox1.Text)

Can someone please show me how to set this up ?
using VB.NET Express 2008
  • Edited byXancholy Saturday, June 07, 2008 9:00 PMadded text
  • Edited byXancholy Saturday, June 07, 2008 9:00 PMadded text
  •  
Xancholy  Saturday, June 07, 2008 8:58 PM

I would strongly recommend you filter this at the data level to save a HUGE headache working with the repeater. The data repeater is a very poorly designed control and as far as I'm concerned I would never use it in any of my applications. Thanks Charlie

  •  
Charlieit123  Tuesday, November 24, 2009 4:19 AM
Hi Xancholy,

The DataRepeater doesn't have a Filter method. Instead you should set the Filter property of the BindingSource for the DataRepeater.

If you would like to implement search instead of filtering, the following Help topic shows how: http://msdn.microsoft.com/en-us/library/cc488282.aspxThe code example could also easily be modified to implement filtering instead of search.

Hope this helps,
Steve Hoag Microsoft aka the V-Bee
shoagMSFT  Tuesday, November 24, 2009 8:46 PM

You can use google to search for other answers

Custom Search

More Threads

• User Control: ToolStrip
• PrintForm with Print Dialog Box
• DataGridViewComboBoxColumn - DropDown
• In VB.net, how to use printer object?
• How to get the things on track ????
• Card Game Starter Kit
• lines and shape containers
• PrintForm Print to File
• Queries related to imgscan.ocx
• Datarepeater added item disappears