AnsweredAssumed Answered

Selected Item is Not Showing in ComboBox(VB.net)

Question asked by Suresh Vijayan on May 17, 2016
Latest reply on May 17, 2016 by Artem Taturevych

Hi,

Currently i working on windows form application,i am new to VB.net. Thus i changed the datagrid cell into ComboBox Cell i add itms to that comboBox cell programatically.While Complies the program comboBox Show the items which i added but i selected anyone of them means its not displaying on the combobox,herewith i given my used code & Images for better understanding below Kindly help me to solve this problem.

  ################################################# USED CODE ##########################################################

'//======DataGrid Cell As ComboBox Cell=========

 

        Dim comboBoxCell As New DataGridViewComboBoxCell

        Dim ComboTypeOfTool As New DataGridViewComboBoxCell

        '//======Operation=====

        comboBoxCell.Items.Add("Reaming")

        comboBoxCell.Items.Add("Tapping")

        comboBoxCell.Items.Add("Boring")

        comboBoxCell.Items.Add("Drilling")

 

        '//======Type Of Cutting Tool=====

        ComboTypeOfTool.Items.Add("Carbide")

        ComboTypeOfTool.Items.Add("HSS")

        ComboTypeOfTool.Items.Add("PCD")

        ComboTypeOfTool.Items.Add("CBN")

 

 

        '//==Specifies The Row Index & Coloumn Index==

        DataGridView1.Rows(0).Cells(3) = comboBoxCell

        DataGridView1.Rows(0).Cells(2) = ComboTypeOfTool

        '//==============================================================

    End Sub

#######################################################################################################################

In First Image i selecting the combo box cell in data grid it shows the Options which i added

 

Pic 1 combo.jpg

In Second Image i selecting the one item which displaying initially

 

Pic 2 Combo.jpg

In this Last  Image Previously selected is not showing when i clicked another cell

Pic 3 Combo.jpg

 

Thanks & Regrads

SureshKumar

Outcomes