Bind RadComboBox at client side using page base method

2 posts, 0 answers
  1. Ganesh
    Ganesh avatar
    5 posts
    Member since:
    May 2012

    Posted 07 May 2015 Link to this post

    .aspx page

    <telerik:RadClientDataSource runat="server" ID="RadClientDataSource1">
            <DataSource>
                <WebServiceDataSourceSettings ServiceType="OData">
                    <Select Url="Products" DataType="JSON" />
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema DataName="d.results">
            </Schema>
        </telerik:RadClientDataSource>

        <div >
            <telerik:RadComboBox ID="RadComboBox1" runat="server" ClientDataSourceID="RadClientDataSource1"
                EnableLoadOnDemand="true" DataTextField="ProductName" DataValueField="ProducasdtID"
                ShowMoreResultsBox="true" ItemsPerRequest="10" EnableVirtualScrolling="true" Width="300px">
            </telerik:RadComboBox>
        </div>

    .cs Page

     protected void Page_Load(object sender, EventArgs e)
            {
                RadClientDataSource1.DataSource.WebServiceDataSourceSettings.BaseUrl = ResolveUrl("http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/client-side-data-binding/Services/NorthwindWcfService.svc/");
            }

     

    how to bind this in page base event instated of webserviceDatasourcesetting but in my another application i am use this code

    <telerik:RadComboBox ID="cbCommodity" Height="100px" Width="200px" 
                                        runat="server" ItemsPerRequest="10" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                        EnableAutomaticLoadOnDemand="true" AccessKey="T" MarkFirstMatch="true" EmptyMessage="Select"
                                        HighlightTemplatedItems="true">
                                        <HeaderTemplate>
                                            <ul>
                                                <li class="col1">HS Code</li>
                                                <li class="col2">Description</li>
                                            </ul>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <ul>
                                                <li class="col1">
                                                    <%# DataBinder.Eval(Container.DataItem, "HSCode")%></li>
                                                <li class="col2">
                                                    <%# DataBinder.Eval(Container.DataItem, "Description")%></li>
                                            </ul>
                                        </ItemTemplate>
                                    </telerik:RadComboBox>

     

    Can i do databind at client side using page base method please give me any demo

  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 12 May 2015 Link to this post

    Hi Ganesh,

    Yes you can. What is the data type that your web method returns? 

    Look here: http://www.telerik.com/forums/radcombobox-with-webapi-service-as-datasource#AkFVWvPUq0uItFYYaK66Bw

    Regards,
    Hristo Valyavicharski
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top