Welcome to the Xceed Community | Help
Community Search  
More Search Options

How do I dynamically add and removing items to and from a list?

Sort Posts: Previous Next
  •  10-10-2008, 10:56 AM Post no. 28424

    How do I dynamically add and removing items to and from a list?

    Create a blank VB project and add three controls to it:
    - A button with the name btnAdd.
    - A button with the name btnRemove.
    - An edit control with the name txtNewItem
    - A SmartUI control called SmartUI1

    Then, in the button add event, you can use the following code to add an item to the list:

    Private Sub btnAdd_Click()
        SmartUI1.SmartItems.Add , , txtNewItem.Text, ListItemFullRow
    End Sub

    Private Sub btnRemove_Click()
        If Not SmartUI1.SelectedItem Is Nothing Then
            SmartUI1.SmartItems.Remove (SmartUI1.SelectedItem.Index)
        End If
    End Sub
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.