If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > data repeater

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-11, 07:59
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
data repeater

I am trying to use the data repeater in a Windows app (not a web form) to display data in an array. All the information I find seems to be for web forms and says to do this:

DataRepeaterName.DataSource=ArrayName
DataRepeater.DataBind()

The Problem I'm having is that there is no DataBind option under the DataRepeater. Any suggestions would be welcome.
Reply With Quote
  #2 (permalink)  
Old 07-04-11, 00:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
wouldn't that be...

Code:
DataRepeaterName.DataSource=ArrayName
DataRepeaterName.DataBind()
If you want to post your code sample we might be able to help some more.
Reply With Quote
  #3 (permalink)  
Old 07-05-11, 21:03
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
Thanks for the reply Rokslide.

I tried both ways (and anything else I could think of) and have been completely unsuccessful using an array as the datasource.

I have found two ways to get what I want using a structure turned class or a dataset. I'm still play with both to figure out the pros and cons for a couple of small apps that I'm working on. One needs to keep user settings from one session to the next and the other fetches data from various txt files each time it is opened. Neither of them use a database.
Reply With Quote
  #4 (permalink)  
Old 07-05-11, 21:16
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I was just reading through some of the documentation for the datareader...

DataRepeater.DataSource Property (Microsoft.VisualBasic.PowerPacks)
Quote:
Setting the DataSource property of the DataRepeater control has no effect. The DataSource properties of the child controls determine what is displayed at run time.
So inside your repeater you should have controls for displaying your data and you bind to them.
Reply With Quote
  #5 (permalink)  
Old 07-07-11, 12:48
rogue rogue is offline
Registered User
 
Join Date: Apr 2004
Location: metro Detroit
Posts: 589
I had the control set to the elements of the array. The closest I got was having the controls display the values of the last record of the array in the controls for all records - if there were 5 records in the array the data repeater would display the values from the last record 5 times.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On