Hello,
I have a WebDropDown v11.1 created by code. When it is created, it is empty and I want to fill it with data when another WedDropDown's value is selected. I am using EnableClientRendering="true and JSON to databind on the client side as in your examples. I have no template in my WebDropDown and I don´t know how to set it. I see in HTML you can set a template:
=
"true
<ClientRenderingTemplate>
<ClientRenderingTemplate
>
<li>Product: ${Data}</li>
<
li
>Product: ${Data}</
</
ClientRenderingTemplate
How I can do this by code? Or these is a way to do it by javascript when I am doing the databind?
Can you provide an example where the data are coming from a webservice?
Thanks
Hi there,
Here is an example that shows how you would bind to a service http://samples.infragistics.com/aspnet/Samples/WebDropDown/Data/BindingToHierarchicalJSON/Default.aspx?cn=drop-down&sid=c9dd40d1-0068-483e-88e0-d6fac427ba2a
In the case of the above example the ajax call is intercepted by mockjax to simulate receiving data via an $.ajax call. Also there is a public function in the javascript API: set_clientTemplate('client template') which you can use in order to set the template before calling the dataBind() method.
Let me know if this example is of any help to you!
Hi,
I have the following problem:
If I have a webdropdown in a aspx page, when the application is running, the source code generated is:
...
<div id="x:140540991.5:mkr:DropDown" class="igdd_FullstepPMWebDropDownListContainer " style="display:none;visibility:hidden;">
<div id="x:140540991.6:mkr:DropDownContents" style="overflow:auto;height:200px;width:400px;">
<ul id="x:140540991.7:mkr:List:nw:1" class="igdd_FullstepPMWebDropDownList ">
<li><a>${Text}</a></li>
</ul>
</div>
Everything works perfectly!
But when I insert the control by code, such as
Dim oDrpDwn As Infragistics.Web.UI.ListControls.WebDropDown
oDrpDwn = New Infragistics.Web.UI.ListControls.WebDropDown
oDrpDwn.EnableClientRendering = True
…
The code generated it hasn´t got any <LI> element!! So when I databind the data, I get no errors but the webdropdown is empty. Why is this?
That is why I think I need to set a template (or something similar), because I don´t have it. I see the webdropdown element has a set_template method. How can I use it? Is there other solution?
Thanks for your help!