Domanda

So my combobox is used to populate a datagridview when user clicks the customersID in the combobox it will popupate the grid. I have the code for populating but the problem is that they combobox does no reset itself. It still shows the current value that was Selected. I wanted to know it is posible to reset the combobox after selected index event. The code below is how i got my combobobox.

       ' after a command and connection was made

        customerAdapt = New SqlDataAdapter(customerQuery,con)

        customerSet = New DataSet
        customerAdapt.Fill(customerSet)


         customerCb.DataSource = adoAddtRs.tables(0)
      customerCb.DisplayMember = "custID"
      customerCb.ValueMember = "custID"
     customerCb.Visible = False
     customerCb.DropDownStyle = ComboBoxStyle.DropDownList
È stato utile?

Soluzione

Try this piece of coding

customerCb.selectedindex = -1

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top