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

RadGridView Delete Rows where Column value in a Set

1 Answer 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Howard
Top achievements
Rank 1
Howard asked on 02 Jul 2012, 03:53 PM
Rather than looping through the rows, testing a cell value and determining if that value is NOT and should be deleted, is there a query against the control I can use to do the same thing?

Conceptually:

delete from radGridView1 where column["ID"].Value not in set (can be a list or some other collection)

Thanks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Jul 2012, 10:57 AM
Hi Howard,

Thank you for writing.

The best way to achieve your scenario is to loop through the grid rows and remove the one that does not meet your criteria. If you want to prevent updating the grid with every deleted row, you can place your deletion logic in a DeferRefresh using:
using (radGridView1.DeferRefresh())
{
    //deletion logic here
}

I hope this helps.

All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Howard
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or