Add/Remove Row

2 posts, 0 answers
  1. Zbigniew Kozłowski
    Zbigniew Kozłowski avatar
    60 posts
    Member since:
    Apr 2010

    Posted 02 Jul 2010 Link to this post

    how can i remove selected row and how can i add new one to the top? Im writing simple email app, and i need to add new rows to the top when messages come, and remove selected row (because someone can delete it, or move to another folder). I know there is an event Deleted and Deleting, but that is not what i need.
  2. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 02 Jul 2010 Link to this post

    Hello Zbigniew,

    You should remove the items from your source collection and the grid will pick this changes and update its UI.

    For example if you want to remove the selected item you can use the following code:

    If you want to add an item as a first row you should insert it in the collection that the grid is bound to:
    ((IList)this.OrdersControl.ItemsSource).Add(new MailMessage())
    assuming that your object is MailMessage and the source collection is ObservableCollection.

    Also you may want to look at our Step-By-Step tutorial for Silverlight illustrating this scenario as well as many others.

    Sincerely yours,
    Stefan Dobrev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top