Reloads the data with the DataConnector.
The Mapping of the loaded data rows.
Reload method removes the rows that were loaded by the last call to LoadData or Reload method and then calls the LoadData to refill the row collection. The new data are inserted to a position of the first removed Row.
If LoadData has not been called before, the command only executes LoadData()
As an alternative, you can use the DataSource property.
The template indices used for the loaded rows are determined by the TemplateIndex and SelectedTemplateIndex properties.
The following example shows the typical usage of Reload method:
[Visual Basic]
Private Sub AdvancedList1_HeaderClick(ByVal sender As Object, _
ByVal e As Resco.Controls.CellEventArgs) Handles AdvancedList1.HeaderClick
Dim orderBy As String
Select Case e.CellIndex
Case 0 ' Sort ascending
orderBy = " ORDER BY name ASC"
Case 1 ' Sort descending
orderBy = " ORDER BY name DESC"
End Select
If Not orderBy Is Nothing Then
' Update command text and reload the data
AdvancedList1.DbConnector.CommandText = "SELECT * FROM customers" & orderBy
AdvancedList1.Reload()
End If
End Sub
[C#]
private void advancedList1_HeaderClick(object sender, Resco.Controls.CellEventArgs e)
{
string orderBy = null;
if (e.CellIndex == 0)
orderBy = " ORDER BY name ASC";
else if (e.CellIndex == 1)
orderBy = " ORDER BY name DESC";
if (orderBy != null)
{
// Update command text and reload the data
advancedList1.DbConnector.CommandText = "SELECT * FROM customers" + orderBy;
advancedList1.Reload();
}
}
AdvancedList Class | Resco.Controls.AdvancedList Namespace