I bind the two comboboxes with table.
one combo contains product and another contains subproduct.
when i clicked first combobox then subproduct of that is filtered in another combo.
when i clicked next,previous ,it is working properly.
but when i go to last record second combo is refreshed means it is not showing proper subproduct.
I know the problem.i given the code on 1st combo_selectedIndexChanged.when i go to last record the SelectedIndexChanged event occur.thats why it is not show me last record proper.which event should i use for this???Someone plz help me!!! i m sending u code.....
Private Sub frmType_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmd = New SqlCommand("select makeName from Make where status='Add' or status='Edit'")
dt1 = New DataTable
dt1 = ob.getDataTable(cmd)
cmbMakeName.DataSource = dt1
cmbMakeName.DisplayMember = "makeName"
cmd = Nothing
cmd = New SqlCommand("select brandName from Brand where status='Add' or status='Edit'")
dt2 = New DataTable
dt2 = ob.getDataTable(cmd)
cmbBrandName.DataSource = dt2
cmbBrandName.DisplayMember = "brandName"
end sub
Private Sub cmbMakeName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbMakeName.SelectedIndexChanged
Dim s As String
s = cmbMakeName.Text
dt3 = New DataTable
dt3 = ob.getSearch("brandName", "Brand", "makeName", s)
cmbBrandName.DataSource = dt3
cmbBrandName.DisplayMember = "brandName"
End Sub
'Biniding of comboboxes
cmbBrandName.DataBindings.Add("Text", dt, "brandName")
cmbMakeName.DataBindings.Add("Text", dt, "makeName")
cm = CType(Me.BindingContext(dt), CurrencyManager)