Remove item from datadatabounlistbox

Thread is closed for posting
2 posts, 1 answers
  1. Sanjeewa
    Sanjeewa avatar
    3 posts
    Member since:
    Nov 2011

    Posted 19 Jun 2014 Link to this post

    I am using this code to populate DataBoundListBox
    1.Dim listDatas As New List(Of Ex_Categories)()
    2.        Using db = New n_DataContext(Common.ConnectionString)
    3.        Dim query = Await System.Threading.Tasks.Task.Factory.StartNew(Function() From cat In db.ExCat Order By cat.n_type Select cat)
    4.        listDatas = Await System.Threading.Tasks.Task.Factory.StartNew(Function() query.OrderBy(Function(c As Ex_Categories) c.n_type).ThenBy(Function(c As Ex_Categories) c.cat_name).ToList())
    5.        End Using
    6.LstCategories.ItemsSource = New ObservableCollection(Of Ex_Categories)(listDatas)

    I know how to remove an item from database.
    I want to know how do i remove a selected item from the DataBoundListBox?
  2. Answer
    Ves avatar
    2914 posts

    Posted 24 Jun 2014 Link to this post

    Hi Sanjeewa,

    RadDataBoundListBox will not handle deletion internally. You will need to perform it by yourself. In order to determine which item to delete you can take advantage of ItemTap or SelectionChanging/SelectionChanged events of the control. This will depend on the specific implementation. You can find more details about events in RadDataBoundListBox here.

    Best regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top