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

[Solved] Autocomplete for ComboBox Freezes After Page is Submitted

3 Answers 158 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Suresh Mishra
Top achievements
Rank 1
Suresh Mishra asked on 24 Sep 2009, 01:43 PM
Hi,

Thank you for your support in the past.  I have an issue with autocomplete for a combo box.

I implemented autocomplete for a rad combo box.  This works fine the first time and items are pulled in as I type the employee name.  However, if I select an employee and then return to select another employee, the auto complete freezes at "uploading...".  Is there a work around for this?  What am I doing wrong?

Thank you very much.

Suresh

Here is the rad combo box declaration:

<telerik:radcombobox id="RadComboBoxEmployeeName" runat="server" AutoPostBack="true" OnItemsRequested="RadComboBoxEmployeeName_ItemsRequested" AccessibilityMode="True" AllowCustomText="True" EnableLoadOnDemand="True" Width="174px"></telerik:radcombobox>

Code behind for RadComboBoxEmployeeName:

Protected Sub RadComboBoxEmployeeName_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
        'add only the companies that meet the search criterion

        Dim objPE As New ProposalEmployee
        Dim dt As DataTable
        dt = objPE.GetAllLikeEmployees(e.Text).Tables(0)

        Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)
        comboBox.Items.Clear()
        For Each row As DataRow In dt.Rows
            Dim item As New RadComboBoxItem()
            item.Text = row("EmployeeName").ToString()
            item.Value = row("EmployeeNo").ToString()
            comboBox.Items.Add(item)
        Next
    End Sub

Selected index change for RadComboBoxEmployeeName:

Protected Sub RadComboBoxEmployeeName_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBoxEmployeeName.SelectedIndexChanged
        Try
            WriteLine("RadComboBoxEmployeeName_SelectedIndexChanged")
            Dim strEmployeeNo As String
            strEmployeeNo = RadComboBoxEmployeeName.SelectedValue
            If strEmployeeNo = "" Then
                Exit Sub
            End If
            Dim objPE As New ProposalEmployee
            Dim ds As DataSet = objPE.GetEmployee(strEmployeeNo)

            lblAssmtDate.Text = ds.Tables(0).Rows(0)("AssessmentDate")
            lblBillRate.Text = "" 'ds.Tables(0).Rows(0)("BillRate")
            lblBurdenedRate.Text = ds.Tables(0).Rows(0)("StandardBurdenRate")
            lblChangedBy.Text = ds.Tables(0).Rows(0)("ChangedUserId")
            lblChangedDate.Text = ds.Tables(0).Rows(0)("ChangedDateTime")
            'lblContractVehicle.Text = ds.Tables(0).Rows(0)("LaborSchedule")
            lblCreatedBy.Text = "" 'ds.Tables(0).Rows(0)("CreatedUserId")
            lblCreatedDate.Text = "" 'ds.Tables(0).Rows(0)("CreatedDateTime")
            lblEducation.Text = "" 'ds.Tables(0).Rows(0)("Education")
            lblEmployeeName.Text = ds.Tables(0).Rows(0)("EmployeeName")
            lblEmployeeNo.Text = ds.Tables(0).Rows(0)("EmployeeNo")
            lblExperience.Text = "" 'ds.Tables(0).Rows(0)("Experience")
            lblOriginalCC.Text = ds.Tables(0).Rows(0)("CC")
            lblProfit.Text = "" 'ds.Tables(0).Rows(0)("Profit")
            lblRefId.Text = "" 'ds.Tables(0).Rows(0)(0)
            lblTitle.Text = ds.Tables(0).Rows(0)("TitleDesc")

            txtTBDWageRate.Text = ds.Tables(0).Rows(0)("StandardCostRate")
            'drpCostCenterForEmployee.SelectedValue = ds.Tables(0).Rows(0)("AdjustedCC")
            drpTBDTitle.SelectedValue = ""  'ds.Tables(0).Rows(0)("TBDTitle")
            'drpSite.SelectedValue = ds.Tables(0).Rows(0)("Site")
            txtAnnualSalary.Text = ds.Tables(0).Rows(0)("AnnualSalary")
            'drpContractVehicle.SelectedValue = ds.Tables(0).Rows(0)("LaborSchedule")
            'drpLaborCategory.SelectedValue = ds.Tables(0).Rows(0)("LaborCategoryCode")
            txtNewNotes.Text = ""
            'txtPrevNotes.Text = ds.Tables(0).Rows(0)("Notes")
            PopulateCostCenterScheduleAndLC()

        Catch ex As Exception
            CmFunc.ErrorLog("PropoposalEmployeeDetails_Load", ex.ToString())
            lblErrorMsg1.Text = ex.Message
        End Try




3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 25 Sep 2009, 01:41 PM
Hi Suresh Mishra,

Could you put a breakpoint in the ItemsRequested event handler and debug to see what happens the second time the ComboBox requests Items? Does the event handler executes the second time and does it execute fully?

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Suresh Mishra
Top achievements
Rank 1
answered on 28 Sep 2009, 08:16 PM

Hi Simon,

 

Appreciate your prompt reply.

 

The ItemsRequesed event handler fires the first time, but it does not fire after that.  I also found that the auto complete works if I set the SmartNavigation to "False" in the web.config files.  However, setting smart navigation to "False" is not a viable option because it makes screen flicker.  Do  you have any other work arounds? 

Thanks.

Suresh

0
Simon
Telerik team
answered on 29 Sep 2009, 03:04 PM
Hello Suresh Mishra,

Thank you for the clarification.

I was unable to reproduce this issue in this online demo (by setting smartNavigation to true in the web.config for the Web Site).

Can you open a support ticket and send us a small project exhibiting the issue? We will inspect it thoroughly and hopefully will provide a solution or a workaround.

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Suresh Mishra
Top achievements
Rank 1
Answers by
Simon
Telerik team
Suresh Mishra
Top achievements
Rank 1
Share this question
or