1

I'm using a DataRepeater control in my VB.Net application so I can make a custom-made list control.

I know it's main functionality is to work with dataSets and stuff, but I don't actually want to transfer my stuff into a database because in the program's context it doesn't actually make any sense.

So my goal here is to use a dataRepeater to list the contents of a mail inbox.

Everything works just fine until I scroll down the control. As I scroll down/up to see every item (in this case, every listed e-mail), the contents disappear and all I can see is a bunch of lines with the controls' default values assigned - like "Label1" and so on.

This is how I'm filling the dataRepeater (abreviated):

    For each m as Message in mail.Inbox
         dr.Addnew()
         With dr.CurrentItem
           .Controls("lblFrom") = m.From
           .Controls("lblSubject") = m.Subject
         End With 
    Next   

As I said, the dataRepeater shows up perfect until I scroll it up/down, and when I do it all the data just disappears remaining only the items with the controls' default (design-time) values.

Am I missing something here? Or is it just not possible to work with a dataRepeater to fulfil my idea?

UPDATE: Got my answer right here!

K09P
  • 480
  • 4
  • 13

1 Answers1

2

The repeater isn't going to hold the values on its own. You dont have to use a datasource, but you have to use something. Here is an example where they used a simple integer array: VB.NET Repeater Simple Data Binding Without Datasource

Community
  • 1
  • 1
Derek Meyer
  • 497
  • 7
  • 22
  • I figured it out: this was what I needed! http://www.vbforums.com/showthread.php?731811-VB-NET-List-bound-to-DataRepeater-in-single-and-multi-threading – K09P Sep 03 '13 at 18:37