is this possible?
i have a datagrid with 2 columns... lets say col1 and col2.. in col2, i have a drop down button which is supposed to list all valid values for it. sorta like list of values.
any ideas?
Printable View
is this possible?
i have a datagrid with 2 columns... lets say col1 and col2.. in col2, i have a drop down button which is supposed to list all valid values for it. sorta like list of values.
any ideas?
You must supply another control that contains the list of values. When the button is clicked move the control into position, make it visible and give it focus. When the user selects a value, write the value to the grid cell, hide the control and put focus back onto the grid control.
This sample code uses a ListBox placed just below the current cell.
Code:Private Sub DataGrid1_ButtonClick(ByVal ColIndex As Integer)
Dim lngLeft As Long
Dim lngTop As Long
lngLeft = DataGrid1.Left + DataGrid1.Columns(ColIndex).Left
lngTop = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row) + DataGrid1.RowHeight
List1.Move lngLeft, lngTop, DataGrid1.Columns(ColIndex).Width
List1.Visible = True
List1.SetFocus
End Sub
Private Sub List1_Click()
DataGrid1.Columns(2).Text = List1.Text
List1.Visible = False
DataGrid1.SetFocus
End Sub
thanks... this seems to work.. just hope it is as easy as in vb.net because i've decided to use vb.net instead of vb6 for my database application.