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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox

Status
Not open for further replies.

cg100

Programmer
Jul 3, 2003
4
MU
Anybody

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.

Thanks in advance
 
Hi cg100,

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

Good luck :-D
 
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.


Anybody can help out ???

 
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 .
 
cg100

can you give me the URL of the article ?
From the remarks, seem that you need to set a "button property to true"
 
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.

CG100
 
cg100,

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.

Vikram.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top