Hi All,
I am trying to use a Webdropdown Control with Multi selection Option Enable and Which is placed in a Update Panel/without Update Panel in Asyc mode as I donot want the control have any postback . based on the Items Selected in this Control i am trying to fill another Dropdown Controls.
But This is Giving the Following Javascript error and Stopping the Funcionality of the Controls.
and if i debug this error found that it is happening in the scripts generated by the infragestics Controls. i tried different way to eliminate the error by changing the control properties page properties. but nothing worked.
Please help me with this error as I have got stuck with this from last 3 days.
Thanks & regards
Balakrishna...
Hi,
In fact I think there is a very easy solution to the issue you are facing, you only need to set this property:
EnableDropDownAsChild="True"
Currently you have it as (False). I can explain what it does - basically when it is true, the dropdown container will be a direct child of the input box, therefore when used in UpdatePanel scenarios, all the cleanup and disposal will happen automatically, in the case when it is set to "False" the container will not be cleaned up, and it will stick in the page.
Also , since you are using UpdatePanel, you cannot add the control directly to the Page, because only the UpdatePanel contents are updated.
Therefore you need to do that instead :
panel1.ContentTemplateContainer.Controls.Add(lbl); // panel1 is the ID of the UpdatePanel holding the WebDropDown
I have tested this and it works fine. Hope this helps,
Angel
If your scenario is different than what's in the ASPX and code behind, please attach the full sample so that i can make it work or suggest workaround if possible.
About the screenshot error - i think this is not quite related to the WebDropDown. This probably happens because somewhere in your code, you have stuff like :
var dropDown = $find(<%= WebDropDown1.ClientID %>);
If you replace that with this (below) it should work:
var dropDown = $find(<%# WebDropDown1.ClientID %>);
But again, if I can have a look at your full scenario, i should have a better idea about what could be wrong.
Maybe instead of adding a control in the ValueChanged event, you can have the control initially, but just make it not Visible. (i.e. Visible=false), and then only change the Visible property to true). I think this should help.
Thanks,
Hi Angel,
Thanks for your Quick response. But it was not able to solve my problem. As I said Based on the Selection of this Drop down I have fill other dropdown's and Even Moved or Add Controls to the Page.
i.e. on ValueChanged Event I have Add a Control to the Page.
protected void WebDropDown1_ValueChanged(object sender, Infragistics.Web.UI.ListControls.DropDownValueChangedEventArgs e) { Label lbl = new Label(); lbl.ID = "TxtID"; lbl.Text = "Mytesting" + DateTime.Now.ToString(); Page.Controls.Add(lbl); }
Please find the Method for the Value Change Event. and the Error Which is Raised.
and Also i Tried to Load the Items into the other Dropdown even That was also not Working.
For FYI : I need to have to Add and change the text and Items of the Controls on the ValueChanged Event of the Dropdown Without Post Back.
Thanks for the Reply. Look Forward For Help...
BK
Hello Balakrishna,
I have modified your sample and attached a WebSite, which does what you want to achieve. Note how i have modified the Postback flag from "On", to "Async". So now you don't need to have the UpdatePanel at all.
Also i am now handling ValueChanged instead of selection changed. That's because with multiple selection, value is changed only when selection has taken place. And if selection causes postback, the value changed code won't be executed on the client side, therefore value won't be set to the new one.
Note that with ValueChanged="Async", selection changed events still fire properly as they should.
I have also removed AutoPostBack=True, since it will trigger full postback for all events (incl. ValueChanged).
Hope this helps. Please let me know if there is something else i can do to help.
Thanks for Replying.
I have Attached the Aspx and Cs file in the attachment. Please Do the needful.
Scenario for the Application:
Basically i am working on a Search page where i will be having 8 Dropdowns in 2 rows which are Dynamic in Behaviour i.e. Based the Database Perferences i will be positioning and Hidding/Showing the controls on to the page.
out of the 8 Dropdownlist one is a dropdown with Multi selection enable in the first row. i.e. dropdown with checkboxes.
in the First Level user can select any dropdown according his wish. based on which the remaining dropdown will be filled i.e. Criscross based Searching.
the next level is forward only dropdowns .
in the first level based on the selection of the first Dropdown The Structure of the other Dropdown will be determined. i.e. there sequence and visibility. and the Second levels first dropdown will be filled.
I am trying to do all this functionality without any postback. because of which i am trying to use Updatepanel with Updatemode as Conditional.
i was able to Achieve the Above said functionality using the normal asp.net control except the Multi selection of the Dropdown. because of which i am trying to Use the infragistics in the place of the Normal controls.
even if you can help me with any way to have a Checkboxlist control placed in the dropdownlist of the ASP.net. that would even serve my purpose.
Thanks one again for Replying. i would be very happy to Receive your Help.
Thanks ®ards