DataRepeater.VirtualMode Property
Gets or sets a value that indicates whether you have provided your own data-management operations for the DataRepeater control.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
public bool VirtualMode { get; set; }
public:
property bool VirtualMode {
bool get();
void set(bool value);
}
member VirtualMode : bool with get, set
Public Property VirtualMode As Boolean
Property Value
Type: System.Boolean
true if the DataRepeater uses data-management operations that you provide; otherwise, false. The default is false.
Remarks
Virtual mode is designed for use with large stores of data. When the VirtualMode property is set to True, you create a DataRepeater with a set number of items and then handle the ItemValueNeeded event to populate the items. Virtual mode requires implementation of an underlying data cache to handle the population, editing, and deletion of DataRepeater items based on actions of the user. For more information about how to implement virtual mode, see .3d5cc14a-2c04-4806-b8e2-b84504160593
Examples
The following code example demonstrates how to change the behavior of a DataRepeater control in the Form_Load event handler, depending on the value of the VirtualMode property. It assumes that you have a form that contains a DataRepeater control named DataRepeater1 that is bound to the Products table of the Northwind database.
// If the DataRepeater is in virtual mode,
// do not allow adds or deletes.
if (dataRepeater1.VirtualMode == true)
{
dataRepeater1.AllowUserToAddItems = false;
dataRepeater1.AllowUserToDeleteItems = false;
// Disable the Add button.
productsBindingNavigator.AddNewItem.Enabled = false;
// Disable the Delete button.
productsBindingNavigator.DeleteItem.Enabled = false;
}
' If the DataRepeater is in virtual mode,
' do not allow adds or deletes.
If DataRepeater1.VirtualMode = True Then
DataRepeater1.AllowUserToAddItems = False
DataRepeater1.AllowUserToDeleteItems = False
' Disable the Add button.
ProductsBindingNavigator.AddNewItem.Enabled = False
' Disable the Delete button.
ProductsBindingNavigator.DeleteItem.Enabled = False
End If
See Also
DataRepeater Class
Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the DataRepeater Control (Visual Studio)
Virtual Mode in the DataRepeater Control (Visual Studio)
242b7066-9b8a-495d-9936-4d1b4f6f6ac3
Return to top