Hi
I have four comboBoxes,
If I have the following case,
(ComboBox1.selectedItem=="ID" && comboBox1.Text=="ID"&&ComboBox1.enabled=true)||
(ComboBox2.selectedItem=="ID" && comboBox2.Text=="ID"&&ComboBox2.enabled=true)||
(ComboBox3.selectedItem=="ID" && comboBox3.Text=="ID"&&ComboBox3.enabled=true)||
(ComboBox4.selectedItem=="ID" && comboBox4.Text=="ID"&&ComboBox4.enabled=true
then the application will continue. Otherwise a message box will be displayed saying that ID option must be selected first and the application will stop.
How to write this complex Condition? this condition needs to be checked when I click on "Start" button.
So, I expect that my application will not display the error message if at least one of the four comboBoxes has the selectedItem="ID" and the text="ID" and the combobox is enabled.
Loading
Hemant SrivastavaPosted Nov 5, 2013, 11:45 AM
Afroz KhanPosted Nov 6, 2013, 9:32 AM
private bool SetCondition(ref DropDownList combo)if(combo.SelectedIndex> 0)return combo.SelectedValue == "ID" && combo.Enabled;
{
else return false;
}Now the method like below
if (SetCondition(combo)) // Pass Combobox Id as reference
Do Operation
Rano AHPosted Nov 5, 2013, 12:27 PM
I have done that already after posting the question and it worked.
Thank you anyway