How to create a data bound control that binds to a row 
Author Message
 How to create a data bound control that binds to a row

In VB6 I'm trying to understand complex data binding so tried to create an
example of a control that binds to a row of data. I can't get it to work and
would appreciate any advice on how to fix it. These were the steps I tried.

- Start a new ActiveX control project and add a flex grid with 10 columns to
UserControl1.
- Set UserControl1's DataBindingBehavior property to 2-vbComplexBound.
- Give UserControl1 a Clip property which delegates to the flex grid's Clip
property using the following code
    Public Property Get Clip() As String
        Clip = MSFlexGrid1.Clip
    End Property
    Public Property Let Clip(ByVal vNewValue As String)
        MSFlexGrid1.Clip = vNewValue
    End Property
- Tick all the data binding options in the Clip property's procedure
attributes.
- Put UserControl1 in run mode, add a standard EXE test project and place an
instance of UserControl1 (called MyCtl) on Form1.
- Add a data control (Data1) to Form1 and point it to the Employees table in
the Northwind example database.
- Set MyCtl's properties as follows:
      DataSource - Data1
      DataField - EmployeeID
- Make the test project the start up project and run it. EmployeeID appears
in the first non-fixed column of the flex grid but all other columns are
empty.
- Set MyCtl's DataField property to blank and run the test project. All
columns in the flex grid are empty.

At this point I ran out of ideas. Thanks in advance for any help.



Wed, 30 Nov 2005 00:25:09 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Data-bound Masked Edit makes all data-bound controls not display data

2. Data-Bound Vs. Non-Data-Bound Controls

3. Data-Bound Vs. Non-Data-Bound Controls

4. Data-Bound Vs. Non-Data-Bound Controls

5. Data Bound User Control Not Binding

6. binding a data bound grid control programmatically

7. ?Data bound controls lost binding after filtering

8. Data designer bound controls seem to lose their binding to the recordset with Requery

9. ?Data bound controls lost binding after filtering

10. Data designer bound controls seem to lose their binding to the recordset with Requery

11. ?Data bound controls lost binding after filtering

12. ?Data bound controls lost binding after filtering

 

 
Powered by phpBB® Forum Software