Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
actually i have 3 combo boxes, all combo boxes having lot of values , but i want small popup box. and in that combo boxes some values are equal, so we should not select same values in those three combo boxes, if select any equal values in any both i want one pop box.


urgent please help me any one please sir, it should work in client system


i write like this but its not working
VB
Private Sub cbAuthoriser1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbAuthoriser1.SelectedIndexChanged
   Try
      If cbAuthoriser1.SelectedIndex <> -1 Then
         If cbAuthoriser1.SelectedItem.Text = cbAuthoriser2.SelectedItem.Text Or cbAuthoriser1.SelectedItem.Text = cbAuthoriser3.SelectedItem.Text Then
            radWindowManagerAlert.RadAlert("Already you are selected this authoriser.Please selected another one.", 300, 250, "Purchase Request", Nothing)
            cbAuthoriser1.ClearSelection()
         End If
      End If
   Catch ex As Exception

   End Try

End Sub

Private Sub cbAuthoriser2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbAuthoriser2.SelectedIndexChanged
   Try
      If cbAuthoriser2.SelectedIndex <> -1 Then
         If cbAuthoriser2.SelectedValue = cbAuthoriser1.SelectedValue Or cbAuthoriser2.SelectedValue = cbAuthoriser3.SelectedValue Then
            radWindowManagerAlert.RadAlert("Already you are selected this authoriser..Please selected another one.", 300, 250, "purchase Request", Nothing)
            cbAuthoriser2.ClearSelection()
         End If
      End If
   Catch ex As Exception

   End Try

End Sub

Private Sub cbAuthoriser3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbAuthoriser3.SelectedIndexChanged
   Try
      If cbAuthoriser3.SelectedIndex <> -1 Then
         If cbAuthoriser3.SelectedValue = cbAuthoriser1.SelectedValue Or cbAuthoriser3.SelectedValue = cbAuthoriser2.SelectedValue Then
            radWindowManagerAlert.RadAlert("Already you are selected this authoriser...Please selected another one.", 300, 250, "purchase Request", Nothing)
            cbAuthoriser3.ClearSelection()
         End If
      End If
   Catch ex As Exception

   End Try

End Sub


Cpode block added, indenting reduced
Posted
Updated 8-May-14 21:42pm
v4
Comments
gnani_pal 9-May-14 3:58am    
its not working nelek sir
Richard MacCutchan 9-May-14 5:10am    
What does "not working" mean? Please edit your question and provide proper details.
gnani_pal 9-May-14 5:49am    
actually i have 3 combo boxes sir, names is cbAuthoriser1,cbAuthoriser2,cbAuthoriser3
if i select one record in cbAuthoriser1, i should not select same records in cbAuthoriser2 and cbAuthoriser3, if i select same record in any orthers it should display a popup box, i am using vb.net web application. it should be work in client side, please help me sir, dnt mind
Richard MacCutchan 9-May-14 6:05am    
Well you still have not explained which part of your code is not working.
Richard MacCutchan 9-May-14 6:53am    
The statement If cbAuthoriser1.SelectedIndex <> -1 Or cbAuthoriser2.SelectedValue <> -1 Or cbAuthoriser3.SelectedValue = -1 Then does not look quite correct. You are also comparing the selected index of each combo rather than the actual data at that position. You could simplify this by saving the selected item each time the selection changes, and comparing with the other selections. I am not sure why you need three comboboxes all containing the same items, but no doubt you have a good reason.

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