Click here to Skip to main content
15,905,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to bind two combobox in datagridview . i want on the selected index of first column1 the filer value is in column2.. then the value of column2 will vary according to first value in combobox in grid.. plzz help
Posted
Comments
[no name] 29-Jul-13 5:41am    
Help you with what?
Mandy Nagra 29-Jul-13 5:45am    
with code ....
Winston Madiano 29-Jul-13 5:51am    
What have you tried?
Samresh.ss 29-Jul-13 6:19am    
Any code you have already tried.
Mandy Nagra 29-Jul-13 6:20am    
Private Sub column_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles column0ComboBox.SelectedIndexChanged
Dim dstemp As New DataSet

sqry = "sp_binditemsize"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = column0ComboBox.SelectedValue
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp, "tbItemMasterHeader")
DataGridView1.DataSource = dstemp.Tables("tbBranchMaster")

Try

Dim dstemp12 As New DataSet
sqry = "sp_binditemsize"
SqlCom = New SqlCommand(sqry, mycon)
SqlCom.CommandType = CommandType.StoredProcedure
SqlCom.Parameters.Add("@code ", SqlDbType.BigInt).Value = 1
SqlCom.Parameters.Add("@itemid", SqlDbType.BigInt).Value = column0ComboBox.SelectedValue
AdpComm = New SqlDataAdapter(SqlCom)
AdpComm.Fill(dstemp12, "tbBankMaster")
Column2.ValueMember = "itemsizeid"
Column2.DisplayMember = "SizeName"
Column2.DataSource = dstemp12.Tables(0)
'If (DataGridView1.CurrentRow.Index = 2) Then
DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(1).Value = dstemp12.Tables(0).Columns(3)
'End If


'DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(1).Value = dstemp12.Tables(0)


'B = Column2.ValueMember.ToString()
Catch ex As Exception
MsgBox(ex.Message)

End Try

End Sub

1 solution

Hi Mandy,

I think you are looking for cascading drop down.
If am right then Try this link[^]
link2[^]
Link3[^]

I hope this helps you a bit.

Thanks,
Rk
 
Share this answer
 
v2
Comments
Mandy Nagra 29-Jul-13 7:32am    
i want in vb.net
♥…ЯҠ…♥ 29-Jul-13 8:17am    
Just google it. You cannot expect someone to do search for you.
Mandy Nagra 29-Jul-13 8:32am    
i want in datagridview cascading
♥…ЯҠ…♥ 29-Jul-13 8:37am    
Have updated my solution, try the above links and let me know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900