0

Hi all. originally i have this problem http://www.daniweb.com/forums/thread283467.html everything works good in IE but in firefox if i try to change the dropdownlist attach to the node in the treeview it seems like at the moment i click the dropdownlist a postback is trigger and dropdownlist go back to the original index selection which is index 0 no data selected. how to avoid this.

thanks for any help.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by jbisono
0

I don;t have any idea about your requirement but do AutoPostBack = false for your dropdown.

Or, put your controls inside UpdatePanel of Ajax..

Hi all. originally i have this problem http://www.daniweb.com/forums/thread283467.html everything works good in IE but in firefox if i try to change the dropdownlist attach to the node in the treeview it seems like at the moment i click the dropdownlist a postback is trigger and dropdownlist go back to the original index selection which is index 0 no data selected. how to avoid this.

thanks for any help.

0

Ok let me give you an idea then. First of all its under a UpdatePanel, second I may say DropDown but i actually using the select control the classic one. if you did read my original post which i attached the link above, I have a treeview of parts like a bill of materials then in some parts i create a select control to show a multiple option of something. here is how i create a single node with a select control attached.

TreeNode tn = new TreeNode();
//Start building the select control
StringBuilder option = new StringBuilder("<option value=''></option>");
//this check if there is more than one option to insert into the select control
if (partid.Field<string>("BUILD_OPT").IndexOf("-") > 0)
{
   foreach (string st in partid.Field<string>("BUILD_OPT").Split('-'))
   {
      option.Append("<option value= '" + st + "'>" + st + "</option>");
   }
}
else
{
   option.Append("<option value='" + partid.Field<string>("BUILD_OPT") + "'>" +   partid.Field<string>("BUILD_OPT") + "</option>");
}
//this is actually what the node text contains. the variable z is just an autoincrement integer that i have in my code.
tn.Text = "<span class='pchange'>" + partid.Field<string>("PART_ID") + (string.IsNullOrEmpty(partid.Field<string>("ENG_ID")) ? "" : "/" + partid.Field<string>("ENG_ID") + "") + "</span>/<select id='D" + z.ToString() + "' class='DLean' name='D" + z.ToString() + "'>" + option.ToString() + "</select>";

now this will show something like

partNo-Pur-SelectControlHere

Like i said in my first statement Internet Explorer i have no problem, In firefox when i click the select control to select another option a postback is trigger. Does anyone knows why could be doing this? I hope i make a little clear my situtation.

thanks for any comments.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.