NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ListManager Class

Manages the position and bindings of a list.

Object
   ListManager

[Visual Basic]
Public Class ListManager
[C#]
public class ListManager
[C++]
public __gc class ListManager
[JScript]
public class ListManager

Remarks

The ListManager manages the position, or currency, of a "list" of items bound to a property on a control.

Requirements

Namespace: System.WinForms

Assembly: System.WinForms.dll

Example [Visual Basic]

The following example binds a TextBox control to a column in a System.WinForms.DataTable, then gets the ListManager for the binding, and sets its position.

[Visual Basic]

' Place the next line into the Declarations section of the form.
Private lm As ListManager

Private Sub BindControl()
   ' Bind A TextBox control to a column in a DataTable in a DataSet.
   Dim t As DataTable
   t = DataSet1.Tables("Suppliers")
   TextBox1.Bindings.Add("Text", t, "CompanyName")
   ' Specify the ListManager for the DataTable
   lm = me.BindingManager(t, "")
   ' Set the initial Position of the control.
   lm.Position = 0
   lm.AllowAdd = True
End Sub

Private Sub MoveNext(lm As ListManager)
   If li.Position = Count - 1 Then 
      MessageBox.Show("You're at end of the records")
   Else
      li.Position += 1
   End If
End Sub

Private Sub MoveFirst(lm As ListManager)
   lm.Position = 0
End Sub

Private Sub MovePrevious(lm As ListManager)
   If lm.Position = 0 Then
      MessageBox.Show("You're at the beginning of the records.")
   Else
      lm.Position -= 1
   End if
End Sub

Private Sub MoveLast(lm As ListManager)
   lm.Position = lm.Count - 1
End Sub

See Also

ListManager Members | System.WinForms Namespace | BindingsCollection | BindingManager | ListBinding