Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Combo box Checkbox how ?

Status
Not open for further replies.

jonybd

Programmer
Nov 3, 2002
166
BE
How could i make a DaTAGrid ?
1. which will be able to have a combo box in any field i want!
2. which will be able to have also a Checkbox in any field ??


useing Adodc1 , datagrid , listview , anything else that support my requirements ?

if then what is that!! ?

thanks
 
There is a good search facility on this site, as this one has been answered many times.

Amongst many others there is a succinct answer from CCLINT in thread222-271034
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
This is how I do it. Case 3 is for another datagrid that will display once the column is clicked.
Case 10 is for a list view that I also use in the same datagrid.


Private Sub DataGrid1_ButtonClick(ByVal ColIndex As Integer)

Select Case ColIndex

Case Is = 3
DataGrid2.Top = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row) + DataGrid1.RowHeight
DataGrid2.Left = DataGrid1.Left + DataGrid1.Columns(DataGrid1.Col).Left
DataGrid2.Width = DataGrid1.Columns(DataGrid1.Col).Width * 6.3
DataGrid2.Height = DataGrid1.RowHeight * 8
DataGrid2.Visible = True

Case Is = 6
If DataGrid1.Columns(3) <> 0 And DataGrid1.Columns(4) > 1 Then MsgBox &quot;Unique item, Quantity will be set to 1&quot;, vbOKOnly
DataGrid1.Columns(4) = 1
DataGrid1.Columns(8) = DataGrid1.Columns(4) * DataGrid1.Columns(7)

DataList1.Top = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row) + DataGrid1.RowHeight
DataList1.Left = DataGrid1.Left + DataGrid1.Columns(DataGrid1.Col).Left
DataList1.Width = DataGrid1.Columns(DataGrid1.Col).Width * 3
DataList1.Height = DataGrid1.RowHeight * 8
DataList1.Visible = True

Case Is = 10
List2.Top = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row) + DataGrid1.RowHeight
List2.Left = DataGrid1.Left + DataGrid1.Columns(DataGrid1.Col).Left
List2.Width = DataGrid1.Columns(DataGrid1.Col).Width * 1
List2.Height = DataGrid1.RowHeight * 3
List2.Visible = True

End Select

End Sub

Hope this helps
David M. Camp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top