Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Multiple combobox with filtering method

$
0
0
Hi,

I have a form with two combobox which is related with each other. All the data is kept in MSSQL database and retrieve using Dataset in VB.net code.
What i want to do when the first user select a value in cb1, cb2 will filtered the data to match the value in cb1. I have tried in many ways but i still couldn't get the result i want.

I've create the SQL syntax inside the datatable as ReturnUnitWt. So inside the code i only call back the SQL.

Eg : cb1 : A, B, C, D
cb2 : AA, AB, BD, BF etc...

    
Private Sub cbBilletSize_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbBilletSize.SelectedIndexChanged

        If Me.cbBilletSize.SelectedValue > 0 Then
            Me.cbUnitWt.SelectedValue = Me.TbCastTableAdapter.ReturnUnitWt(Me.cbBilletSize.SelectedValue)
        Else
            Me.cbUnitWt.SelectedValue = DBNull.Value
        End If

    End Sub


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>