Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > DataRepeater Example


Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2008, 06:57 PM
JerryEng JerryEng is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Easley, SC
Posts: 201
Default DataRepeater Example


Could anyone give me an example of using the datarepeater control in VB6?

I have created a simple OCX (ContactsCTL) with 4 text boxes (for example: text1, text2, text3, text4). I have loaded this into the project and set the datarepeater repeatedcontrolname to ContactsCTL.ctl. In code, I have created a recordset (rs) and have set the datarepeater datasource = rs.
Now, how do I bind the textboxes in the OCX/datarepeater to a field in the rs?
__________________
Visit Easley SC
Reply With Quote
  #2  
Old 10-16-2008, 06:52 PM
JerryEng JerryEng is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Easley, SC
Posts: 201
Default

I figured out how to bind the data in the recordset to the the datarepeater. That part is working great.

My question now is how can I get information from the repeater if the user double-clicks on a record? My OCX has 4 text boxes and property names CompanyName, AcctNum, Phone1 and Phone2. If the user double clicks on the datarepeater, I want to get the AcctNum of the record they clicked on. This is my first attempt with a datarepeater. So far, it is great for displaying the data in a custom format but I'm just not sure how to get info from it.
__________________
Visit Easley SC
Reply With Quote
  #3  
Old 10-17-2008, 12:30 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,386
Default

I haven't used it. But, per MSDN
Quote:
Originally Posted by MSDN
The DataRepeater control is a composite control; a control that hosts other controls. It allows you to specify a control to repeat, and when bound, displays the selected control for each record retrieved. The DataRepeater will then allow end users to scroll through the retrieved records.

To link the DataRepeater control
  1. In the All property tab, set the DataSource property to an ADO Data Control.
  2. In the All property tab, select a control to repeat for the Repeated Control Name property.
  3. Once a control is selected, go to the RepeaterBindings tab.
  4. Set a property name to bind. The drop-down box will enumerate bindable properties in the control to be repeated.
  5. Set a data field. The drop-down box will enumerate column names returned from the bound ADO Data Control.
  6. Click on the Add button to add the binding. The RepeaterBindings list box will then populate with the new binding.
The DataRepeater control also ships separately with Visual Studio 6.0.
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->