CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Data grid

  1. #1
    Join Date
    Jun 2001
    Posts
    29

    Data grid

    Is it possible to put a data combo into the datagrid's cell? How to do that?


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Data grid

    'Reference: Microsoft ActiveX Data Objects 2.5 Library

    'Place this section at top of form
    Private WithEvents rsADOSetRecord As ADODB.Recordset
    Private adoDataGrid As ADODB.Connection

    Private Sub sbLoadCombo()
    Set adoDataGrid = New ADODB.Connection
    Set rsADOSetRecord = New ADODB.Recordset
    With rsADOSetRecord
    .Open "SELECT DISTINCT " & strFiledName & " FROM " & strTableName, adoDataGrid, , , adAsyncFetch
    If Not .BOF Then
    .MoveFirst
    Do While Not .EOF
    If .Fields(0).Value <> vbNull Then combo1.AddItem .Fields(0).Value
    .MoveNext
    Loop
    End If
    .Close
    End With
    End Sub


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured