MobileForms Toolkit Documentation

ValidateDataArgs Class

ValidataDataArgs class contains the arguments of ValidateData event.

For a list of all members of this type, see ValidateDataArgs Members.

System.Object
   Resco.Controls.AdvancedList.ValidateDataArgs

public class ValidateDataArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The data provided to handler of the ValidateData event were loaded from the IDataConnector or DataSource and can be changed. The DataRow contains the values and template indices and can be changed before it is displayed. The InsertIndex contains the position, to which the DataRow will be inserted. If Skip is set to true, the DataRow will not be inserted.

Example

[Visual Basic]

Private Sub AdvancedList1_ValidateData(ByVal sender As Object, ByVal e As Resco.Controls.ValidateDataArgs)_
 Handles AdvancedList1.ValidateData
    ' we will use the validate data handler to load tasks by the priority
    ' before LoadData or Reload we set highPriorityIndex = 0
    
    Select Case e.DataRow("Priority")
        Case "High"
            ' We will load high priority tasks to the first positions
            e.InsertIndex = highPriorityIndex
            highPriorityIndex = highPriorityIndex + 1
        Case "Normal"
            ' and add the normal priority tasks to the end
            e.InsertIndex = -1
        Case "Low"
            ' as an exaple, we will ignore the low priority tasks
            e.Skip = True
    End Select
End Sub
            
[C#]

private void AdvancedList1_ValidateData(object sender, Resco.Controls.ValidateDataArgs e)
{
    // we will use the validate data handler to load tasks by the priority
    // before LoadData or Reload we set highPriorityIndex = 0
    
    switch ((string)e.DataRow["Country"])
    {
        case "High":
            // We will load high priority tasks to the first positions
            e.InsertIndex = highPriorityIndex++;
        case "Normal":
            // and add the normal priority tasks to the end
            e.InsertIndex = -1;
        case "Low":
            // as an exaple, we will ignore the low priority tasks
            e.Skip = true;
    }
}
            

Requirements

Namespace: Resco.Controls.AdvancedList

Assembly: Resco.AdvancedList.CF3 (in Resco.AdvancedList.CF3.dll)

See Also

ValidateDataArgs Members | Resco.Controls.AdvancedList Namespace | ValidateData