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

why radCombobox ItemDataBound taking too much time, for bounding data ?

2 Answers 276 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 30 Oct 2017, 07:27 PM

Hi

im using a RadComboBox with ItemTemplate  like below:

 

 <telerik:RadComboBox ID="RadComboBoxPart" runat="server" Width="251px"
                                        DropDownWidth="540" DataSourceID="sqlParts"  EmptyMessage="Choose Your Part ..." HighlightTemplatedItems="true"
                                        MarkFirstMatch="true" EnableLoadOnDemand="true" Filter="Contains"
                                        AutoCompleteSeparator="|"
                                        Culture="fa-IR" LoadingMessage="Please Wait!" RenderMode="Mobile"
                                        Sort="Ascending" OnItemDataBound="RadVehicle_ItemDataBound" OnItemsRequested="Radpart_ItemsRequested">
                                        <HeaderTemplate>
                                            <table style="width: 360px;">
                                                <tr>
                                                    <td style="width: 280px;">PartName                      </td>
                                                    <td style="width: 80px;">PartCode                         </td>
                                                </tr>
                                            </table>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <table style="width:360px">
                                                <tr>
                                                    <td style="width: 280px;">
                                                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("PartName") %>'></asp:Label>
                                                    </td>
                                                    <td style="width: 80px;">
                                                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("PartCode") %>'></asp:Label>
                                                    </td>                                               
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </telerik:RadComboBox>

 

and for DataSource i'v got this:

 

 <asp:SqlDataSource ID="sqlParts" runat="server"
                                        ConnectionString="<%$ ConnectionStrings:Gsgdb_tempConnectionString %>"
                                        SelectCommand="select * from dbo.ActiveParts ></asp:SqlDataSource>

 

and in Code Behind for ItemDataBound Event i'v got this:

 

protected void RadComboBoxPart_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
        {
            e.Item.Text = ((DataRowView)e.Item.DataItem)["PartName"].ToString();
            e.Item.Value = ((DataRowView)e.Item.DataItem)["ID"].ToString();
        }

its work fine for me !

but it's taking too long to load in clintside

what am i doing wrong? any help would be appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 31 Oct 2017, 10:38 AM
Hi,

You can see how to optimize the combobox in the this help article. There is also an online demo: http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx.

Other optimization techniques like setting debug="false" in the web.config are discussed in this article.

Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mohammad
Top achievements
Rank 1
answered on 31 Oct 2017, 07:27 PM

Hi Rumen, thanks a lot

those articles was helpful, but not in my case exactly,

My problem is not on page loading, it is when user click on RadComboBox for selecting item, i'v figured it out that i must use ItemRequest some how to achieve faster load on demand
but i'm not sure how !?
isn't if user filter something that Contains large amount of similar Items, it take too much time like a previous Solution?

 

thank you

Tags
ComboBox
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Mohammad
Top achievements
Rank 1
Share this question
or