tags:

views:

89

answers:

1

I want to make custom combo box which have contain datagrid and textbox too. On clicks into combo box datagridview should be appear and selecting any row particular cell value of the datagridview added on the combo. thanks in advance..

A: 

As your question is written I have no idea how to answer it, I can't figure out how you could sensibly show a DataGridView inside a ComboBox. I'm writing this answer with the assumption that you mean that the form should have a ComboBox that are "linked" to a DataGridView rather than actually contain it.

If so, all you need to do is to add the ComboBox and DataGridView to the form, make the DataGridView invisible. Then you handle the SelectedIndexChanged event for the ComboBox, in the handler, make the grid visibile, find the index of the row and column you want to show and write code like (code not tested so might not be correct):

grid.SelectedRows.Clear()
grid.FirstDisplayedScrollingRowIndex = rowIndex
grid.Rows(rowIndex).Cells(colIndex).Selected = True
grid.Show()    
ho1