Client Side Template Without WebService Binding

2 posts, 0 answers
  1. TGMSoft Developer
    TGMSoft Developer avatar
    1 posts
    Member since:
    May 2014

    Posted 27 Jan 2015 Link to this post

    I need to have a client side template on my application without using webservice binding.

    When I try to use client side template with other types of databing like datatable or arraylist the client side template does not
    maintain its layout.

    The reason I need this is because I need client side template with load on demand.

    For example: 
    * The bellow code adds an item but doens't preseve the client template
    Dim itemData As New RadListBoxItem()
    itemData.Text ="Text"
    itemData.Attributes.Add("Attr1", "Attr1")
    itemData.Attributes.Add("Attr2", "Attr2")
    itemData.Attributes.Add("Attr3", "Attr3")

    * The code below works when its set as webservice biding
    Dim result As New List(Of RadListBoxItemData)()
    Dim itemData As New RadListBoxItemData()
    itemData.Text = "Text"
    itemData.Attributes.Add("Attr1", "Attr1")
    itemData.Attributes.Add("Attr2", "Attr2")
    itemData.Attributes.Add("Attr3", "Attr3")

    Return result.ToArray()
  2. Nencho
    Nencho avatar
    1784 posts

    Posted 30 Jan 2015 Link to this post


    In order to properly bind the added items at server-side, when client templates are used, you should call the bindTemplate() for each item. I have prepared a sample example, demonstrating such implementation, which you can find attached.This and more information on the matter, could be found in the Client Templates documentation article :

    However, if you need to bind the controls at server-side, we recommend the usage of the  ItemTemplates, as demonstrated in the documentation article below:


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top