How can I insert a combo box in a particular cell in the datagrid(OLEDB). Say when focus is on a particular cell the drop down list should appear for me to select any of its contents.
I don't think it is possible to insert anything into the datagrid. However, you can try to change the value of the field of access before you use the datagrid.
Change it to lookup before you proceed with datagrid and enter the values that you want.
Anyway, the datagrid is best for viewing purposes. It is not very nice to try to edit values of a particular field from the datagrid
Lone 84
Thanks for your comments but in the MSDN library it is written that it can be done.Occurs when the current cell's built-in button is clicked.
These are what is written in the documentation:
Private Sub object_ButtonClick([ index As Integer,] ByVal colindex As Integer)
The ButtonClick event syntax has these parts:
Part Description
object Anobject expression that evaluates to an object in the Applies To list.
Index An integer that identifies a control if it is in acontrol array.
colindex An integer that identifies the column whose button was clicked.
Remarks
The built-in button is enabled for a column when its Button property is set to True.
Typically, you enable the column button when you want to drop down a Visual Basic control (such as the built-in combo box, a bound list box, or even another DataGrid control) for editing or data entry. When the button in the current cell is clicked, the ButtonClick event will be fired. You can then write code to drop down the desired control from the cell.
I use Sheridan Controls (Data Grid OLEDB) and there it is very easy to insert a combo box in a cell and when that particular cell gets focus , the combo can be dropped down .
Vinu28
Possible to give coding details to be able to do this
Lone84,
Sorry don't hv URL as I got it from the MSDN CD. Also when you enabled the button the only thing that it does is show the drop down button when that particular cell gets focus. Afterwards you have to write some code in the button click event to be able to get the combo box in it which is exactly what I have been trying since yesterday.
It is a third party tool so u need to install sheridan controls first . They are very easy to use . At design time u set some propreties and u are almost done .
If u need further help for this then dont hesitate .
Best of Luck.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.