I am populating a listbox on a callback like this
Protected Sub ddlUnmappedFields_Callback(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxClasses.CallbackEventArgsBase) Handles ddlUnmappedFields.Callback
Using ds As New DataSet
ds.ReadXml("c:\test" & ddlSystems.Value & "" & ddlRuns.Value)
Dim alUnmapped As New ArrayList
For Each dc As DataColumn In ds.Tables("Historical").Columns
If Not dc.ColumnName.Equals("DataID") And Not dc.ColumnName.Equals("DataDate") And Not dc.ColumnName.Equals("Recipe") Then
Dim li = ddlMappedFields.Items.FindByText(dc.ColumnName)
If li Is Nothing Then
alUnmapped.Add(dc.ColumnName)
End If
End If
Next
alUnmapped.Sort()
With ddlUnmappedFields
.Items.Clear()
.DataSource = alUnmapped
.DataBindItems()
End With
End Using
End Sub
The items show up in the listbox fine. This listbox is in a callback panel with several other controls and when a perform a callback on the panel there are no items listed.
We have closed this ticket because another page addresses its subject:
ASPxListBox synchronization with server on ASPxCallback
Hello Patrick,
When you perform ASPxCallbackPanel's callback, it is necessary to re-bind the ASPxListBox control with the last callback parameter to restore the Items collection (since it has been created by ASPxListBox's callback). For example, you can create a special method, which accepts the ASPxListBox instance and the callback parameter and call this method from the ASPxListBox's Callback event handler and from the ASPxCallbackPanel's Callback event handler.
To resolve this issue, it is also possible to use the approach, illustrated in the ASPxListBox synchronization with server on ASPxCallback report.
Thanks,
Mike