I have a DataGridView control that is bound to a custom typed list (which inherits a BindingList). I would like to be able to filter rows based on a simple column value (type bool). Ultimately, the goal is to mark the item as deleted, but just mark it as deleted in the DataSource, and not delete it. Juste remove it from the grid, not from the DataSource.
Any idea?
You can use LINQ to filter your data, and then create a new BindingList and reassign it to dataGridView.
, person, WillBeDeleted:
WillBeDeleted
dataGridView1.DataSource = new SortableBindingList<Person> (SampleData.Where(p => !p.WillBeDeleted).ToList());
!
, SortableBindingList http://www.timvw.be/presenting-the-sortablebindinglistt-take-two/ ( VB.NET)
, SortableBindingList .
Private mListeNotes SP1ZSortableBindingList ( SP5004ZNoteEvolutiveEntite)
, , . , , .
Source: https://habr.com/ru/post/1774115/More articles:Conversion error while converting nvarchar to int - sql-serverWhat Drupal Views looks like between multiple displays with the same path - viewsSilverlight - brings a pop-up window to the fore - silverlightGoogle Chrome инструменты для разработчиков: выбор элементов на основе класса css - google-chromeIn Python, how can you answer method calls that don't exist on an object? - pythonHow to compare the hierarchical order of two subzones? - iphoneLooking for an online application with many complex shapes and grids - web-applicationsWhy is function () sometimes required in JavaScript? - javascriptSharepoint: Where can I store the assets used on my custom homepage? - sharepointAndroid: Tabstyle - androidAll Articles