Large number of record binding in combobox with checkbox

4 posts, 0 answers
  1. MIS-GSC
    MIS-GSC avatar
    4 posts
    Member since:
    Oct 2013

    Posted 09 Mar 2015 Link to this post

    Dear Sir,

    There is user requirement to using combobox with checkbox for mulit-selection of code.  If "top 10" was removed the combobox didn't show any record. After check that, there are almost 7xxx records, do you mean that the combobox with checkbox with max. limitation of the record? If yes, what is the max. number of the records?
    There is the code:
    .aspx
     <telerik:RadComboBox runat="server" ID="cboSupplier" 
          CheckBoxes="true" EnableCheckAllItemsCheckBox="true"
          AutoPostBack="false" CssClass="comboBoxStyle"
          DataTextField="SUPCD"
          
         EnableLoadOnDemand="True"  Height="200px" Width="95%">
    </telerik:RadComboBox> 

    .vb
     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     If Not Me.IsPostBack Then
     LoadSupplier()
    end if
    End Sub
      Protected Sub LoadSupplier()
            cboSupplier.Items.Clear()
            Dim dbConn As New SqlConnection(WebConfigurationManager.ConnectionStrings("PDBConnectionString").ConnectionString)
            Dim adapter As New SqlDataAdapter("SELECT top 10 RTRIM(MSUP_SUPCD) MSUP_SUPCD,RTRIM(MSUP_SUPNM) MSUP_SUPNM FROM MSUP_TBL Group by RTRIM(MSUP_SUPCD) ,RTRIM(MSUP_SUPNM) ORDER By MSUP_SUPCD ", dbConn)
            Dim dt As New DataTable()
            adapter.Fill(dt)
            cboSupplier.DataTextField = "MSUP_SUPCD"
            cboSupplier.DataValueField = "MSUP_SUPCD"
            cboSupplier.DataSource = dt
            cboSupplier.DataBind()
            ' Insert the first item.
            cboSupplier.Items.Insert(0, New RadComboBoxItem("", ""))
        End Sub








  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 11 Mar 2015 Link to this post

    Hello,

    I am afraid that I am not quite sure that I had understood your inquiry. Could you elaborate bit more on the experienced issue? In addition, I noticed that you had enabled the LoadOnDemand functionality of your RadComboBox, while you are using the CheckBoxes feature. This is a not supported scenario and it is described in the following documentation article :

    http://www.telerik.com/help/aspnet-ajax/combobox-usability-checkboxes.html

    Regards,
    Nencho
    Telerik
     

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. MIS-GSC
    MIS-GSC avatar
    4 posts
    Member since:
    Oct 2013

    Posted 11 Mar 2015 Link to this post

    As your suggest, the code as below:
    aspx code:
    <telerik:RadComboBox ID="cboSupplier" runat="server" AutoPostBack="false"
            Enableitemcaching="true"
            CheckBoxes="true"
            DataTextField="SUPCD"
            DataValueField="SUPCD"
            Height="200px" Width="95%" CssClass="comboBoxStyle"  >
    </telerik:RadComboBox>

    vb code:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
         If Not Me.IsPostBack Then
                LoadSupplier()
         end if
    end sub
     
    Protected Sub LoadSupplier()
            Dim dbConn As New SqlConnection(WebConfigurationManager.ConnectionStrings("DB_Conn").ConnectionString)
            Dim adapter As New SqlDataAdapter("SELECT  RTRIM(SUPCD) SUPCD,RTRIM(SUPNM) SUPNM FROM SUPPLIER Group by RTRIM(SUPCD) ,RTRIM(SUPNM) ORDER By SUPCD", dbConn)
            Dim dt As New DataTable()
            adapter.Fill(dt)
            cboSupplier.DataTextField = "SUPCD"
            cboSupplier.DataValueField = "SUPCD"
            cboSupplier.DataSource = dt
            cboSupplier.ItemsPerRequest = 10
            cboSupplier.CheckedItemsTexts = 0
            cboSupplier.AllowCustomText = False
            cboSupplier.EnableCheckAllItemsCheckBox = True
            cboSupplier.LoadingMessage = ""
            cboSupplier.ItemRequestTimeout = 0
            cboSupplier.DataBind()
    End Sub

    For more information:
    The borswer is IE8 and the Telerik dll version is 2013.3.1114.40
    During loading the page, this message box was prompt as attachment. As bold "SQL" if I modified to "SELECT  TOP 100 RTRIM(SUPCD) SUPCD,RTRIM(SUPNM) SUPNM FROM SUPPLIER Group by RTRIM(SUPCD) ,RTRIM(SUPNM) ORDER By SUPCD", the message didn't be prompt again. Then, I tried the max. Top X, up to Top 4000, the message didn't be prompt, but Top 5000, the message box was prompt. Actually, there are over 7000 records in table. Besides that the Top X which didn't be prompt the message box during loading, the performance of opening the combobox list is slow, around 3-5 seconds.
    Do you have any solution for this case?
  5. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 16 Mar 2015 Link to this post

    Hello,

    I am afraid that I was unable to find any message that you mentioned. However, having in mind the large data that you attempt to bind the RadComboBox with - the massage probably describes the inability of the browser to render such amount of html.

    For such scenarios, we recommend the usage of LoadOnDemand, where you can specify ItemsPerRequest (this property is valid only for LoadOnDemand scenario) and load the data in portions.

    However, as previously mentioned, using the Checkboxes feature in a LoadOnDemand scenario is not supported. This is why, I could suggest you the following workaround - use the ItemTemplate of the RadComboBox to apply the needed Checkboxes and have the LoadOnDemand enabled at the same time. In addition, I would suggest you to refer to the following forum thread, where a colleague if mine had provided a sample example regarding this custom implementation:

    http://www.telerik.com/forums/radcombo-multi-select-and-load-on-demand

    Regards,
    Nencho
    Telerik
     

    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