This is a migrated thread and some comments may be shown as answers.

Bind RadComboBox at client side using page base method

1 Answer 193 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ganesh
Top achievements
Rank 1
Ganesh asked on 07 May 2015, 02:20 PM

.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

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 12 May 2015, 06:41 AM
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.

 
Tags
ComboBox
Asked by
Ganesh
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or