This is a migrated thread and some comments may be shown as answers.

AutoCompleteBox: Textblock removed event

1 Answer 109 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 19 Apr 2013, 08:32 PM
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.

Thanks

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 24 Apr 2013, 01:05 PM
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.
Tags
AutoCompleteBox
Asked by
John
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or