Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datagrid combo
Message
 
À
25/11/2002 05:25:56
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00726350
Message ID:
00726379
Vues:
15
The datagrid doesn't display any combo (whatever the property you set!)


This example uses a list box, but you can replace the name of the list control with a combobox to achieve the same result :

Replace grdCensus with your grid control name.

First in the click command of the list/combo control :
Private Sub DBList1_Click() 

grdCensus.Col = 2 'replace with the column you need 
grdCensus.Text = DBList1.Text 
grdCensus.SetFocus 
grdCensus.Col = 3 'the next col you want to have focus 
DBList1.Visible = False 

End Sub 

In the RowColChange event of your grid : 

With grdCensus 
'in the code below replace 2 with your column # 
   If .Col = 2 And .Text = "" Then 
      DBList1.Left = .Left + .Columns(2).Left 
      DBList1.Top = .Top + (.Row * .RowHeight) + SSTab1.Top 
'the line below makes sure the list isn't being shown off 
'the bottom of the screen. You'll need to adjust the value 
'3600 as needed depending on your forms size and position 
      If DBList1.Top > 3600 Then DBList1.Top = 3600 
      DBList1.ZOrder 0 
      DBList1.Visible = True 
      DBList1.SetFocus 
   Else 
      DBList1.Visible = False 
   End If 
end with
>hi,
>i am using data grid (unboundly) for data entry in my VB application.
>in that i want to activate the combo box in one of the columns. i changed its column style property to Button but the too its not giving the effect of combo box
>how should i do this..
>
>thanx in advance
>Amol(Charlie)
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform