Edit: The following content applies to ASP.NET Ajax 4.0 Preview 4. Download the project that uses the latest MS Ajax 4.0 Preview 6 from Here
Many of you have asked us, the ASP.NET support officers, whether RadComboBox supports templates when bound to WebService. Using the latest official .NET Framework (3.5) the answer was ‘no’.
Fortunately, this is possible with the client-side templates introduced in the next version of the .NET Framework – 4.0. Currently it is in a Preview stage and you can find its roadmap here.
We have already demonstrated how to use the new client-side templates in RadTreeView and RadGrid.
The demo that you can download below shows how to create a multi-column RadComboBox bound to WebService. Here are the important steps that you need to perform:
1. Register the MicrosoftAjaxTemplates.js file in the ScriptManager:
2. Configure a RadComboBox instance to consume a web service:
3. Add a LinqToSql class and drop the Employee table from the Northwind database.
4. Write the GetEmployees web service method which is used to populate RadComboBox:
5. Add the client-side template:
6. Consume the OnClientItemDataBound event (which is a brand new client-side event occurring when an item is created during web-service load on demand) and instantiate the template inside the item's <LI> HTML element:
That’s it. You have a fast combobox with client-side templates.
Edit: Download the project that uses the latest MS Ajax 4.0 Preview 6 from Here
Iana Tsolova is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.
Subscribe to be the first to get our expert-written articles and tutorials for developers!