AutoCompleteBox: Textblock removed event

2 posts, 0 answers
  1. John
    John avatar
    14 posts
    Member since:
    Apr 2013

    Posted 19 Apr 2013 Link to this post

    Hey Telerik!

    Is there an event that I can use to determine when a user has removed a textblock from the textbox?  I would need to be able to get the value for the removed object.

  2. Ivan Petrov
    Ivan Petrov avatar
    718 posts

    Posted 24 Apr 2013 Link to this post

    Hello John,

    Thank you for writing.

    You can subscribe to the CollectionChanged event of the RadAutoCompleteBoxElement Items collection. In this collection are stored all the tokens that have been built. Here is the code:
    ((RadAutoCompleteBoxElement)this.radAutoCompleteBox1.TextBoxElement).Items.CollectionChanged += Items_CollectionChanged;
    private void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        if (e.Action == NotifyCollectionChangedAction.Remove)
            //Handle block remove

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Kind regards,
    Ivan Petrov
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top