We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

deleting from a GridDataControl which is data bound

Thread ID:





84529 Jul 1,2009 07:33 AM UTC Jul 1,2009 12:18 PM UTC WPF 1
Tags: GridControl
Hayden Shilling
Asked On July 1, 2009 07:33 AM UTC

The default delete functionality of the grid when the delete key is pressed only seems to work once on the first key press so I disabled this and tried to write my own on key press (for the delete key)

int itemIndex = grid.Model.CurrencyManager.CurrentRecordIndex;

(grid.ItemsSource as ObservableCollection).RemoveAt(itemIndex);

// This works but
// CurrentRecordIndex will now be -1

// this line of code almost makes it work by setting the new current row to what it was before delete. The only problem here is that the row selector dissappears from the UI

Also when the grid is grouped the concurrency manager will return the wrong index.

Is there an easier way to delete records from a bound grid?

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On July 1, 2009 12:18 PM UTC

Hi Hayden,

Thanks for using Syncfusion products.

Deleting a row directly from the Grid is quite tricky and the internal logics that does this functionality is marked internal. The best way to do is to access the underlying source and directly remove it from the list. I have a sample created for you that does it,


Please check it out and let me know if you want any more details.

Grid.WPF Team
Syncfusion Inc.,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon