I have a situation that I don't know how to resolve. Based on a dropdownlist, I want to:
1. Make 1 of two items invisible
2. Rebuild the toolbar with only the items I want to see
My tool bar would have with a dropdownlist and a combobox or a dropdownlist with a text box, (depending on the selected value of the dropdownlist)
Now I've noticed that I can build a toolbar on the fly. But no mention on templated items
Making each item visible/invisible on the client side isn't an option, as the screen starts to look odd after a few times of making the two items invisible & invisible..
I wrote some C# code to handle making it visible on the server side, but failed:
1. Make 1 of two items invisible
2. Rebuild the toolbar with only the items I want to see
My tool bar would have with a dropdownlist and a combobox or a dropdownlist with a text box, (depending on the selected value of the dropdownlist)
Now I've noticed that I can build a toolbar on the fly. But no mention on templated items
Making each item visible/invisible on the client side isn't an option, as the screen starts to look odd after a few times of making the two items invisible & invisible..
I wrote some C# code to handle making it visible on the server side, but failed:
protected void OnSelectedIndexChanged_ddUserSearchContext(object sender, EventArgs e)
{
RadComboBox MakerRadCombo = (RadComboBox)RadToolbar1.FindControl("MakerRadCombo");
DropDownList ddUserChoce = (DropDownList)RadToolbar1.FindControl("ddUserSearchContext");
TextBox tbSearchContractNo = (TextBox) RadToolbar1.FindControl("tbSearchContractNo");
if (ddUserChoce.SelectedValue == "Contract")
{
MakerRadCombo.Visible =
false;
tbSearchContractNo.Visible =
true;
}
else if (ddUserChoce.SelectedValue == "Maker")
{
MakerRadCombo.Visible =
true;
tbSearchContractNo.Visible =
false; ;
}
}
It fails because tbSearchContractNo = null (it's invisible in the beginning)
Any insight would be helpful.
Thanks in advance,
Al Gorup