Completed
Last Updated: 07 Jul 2014 07:42 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 30 Jun 2014 06:56
Category:
Type: Bug Report
0
FIX. RadDropDownList - SelectedIndexChanged event does not always fire
To reproduce: 
1.Add two RadDropDownListControls
2.Use the following code:
Private _doDisable As Boolean = False

Sub New()
    InitializeComponent()

    Dim parentDataTable As New DataTable
    parentDataTable.Columns.Add("P1", GetType(Decimal))
    parentDataTable.Columns.Add("P2", GetType(String))

    parentDataTable.Rows.Add({1, "ABC"})
    parentDataTable.Rows.Add({1, "ABCD"})

    dd1.DataSource = parentDataTable
    dd1.ValueMember = "P1"
    dd1.DisplayMember = "P2"

    dd1.SelectedIndex = -1
    dd2.SelectedIndex = -1
End Sub

Private Sub dd1_SelectedIndexChanged(sender As Object, e As UI.Data.PositionChangedEventArgs) _
    Handles dd1.SelectedIndexChanged

    Dim childDataTable As New DataTable

    childDataTable.Columns.Add("P1", GetType(Decimal))
    childDataTable.Columns.Add("P2", GetType(String))

    If dd1.SelectedIndex = 0 Then
        For x = 1 To 2
            childDataTable.Rows.Add({x, x.ToString})
        Next x
    End If

    If dd1.SelectedIndex = 1 Then
        For x = 3 To 4
            childDataTable.Rows.Add({x, x.ToString})
        Next x
    End If

    dd2.DataSource = childDataTable
    dd2.ValueMember = "P1"
    dd2.DisplayMember = "P2"
End Sub

3.Follow the steps:
Dropdown 1 contains two entries "ABC" & "ABCD"
Dropdown 2 is populated conditionally on selected index change of dropdown 1.
For "ABC" dropdown 2 contains 1 and 2, and for "ABCD" contains 3 and 4.

1 - In dropdown 1, type ABC and tab out
2 - In dropdown 2, select any value
3 - Now click the arrow to "dropdown" dropdown 1 again, but click the arrow again to cancel the dropdown, cursor is at the start of the ABC. Now click in the text area so cursor moves to the end of the text and type D. There doesn't appear to be any auto complete operation performed even though this should auto complete to entry 2.
4 - Tab out.

Dropdown 2 is not updated as the selected index change event is not fired for dropdown 1 as ABCD wasn't matched against row 2.

5 - Now "dropdown" dropdown 1 again, and the change event now fires late and correctly updates the second dropdown.
0 comments