المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Changing DataGridView selection



C# Programming
06-12-2009, 06:51 PM
This is a bit of an odd question, but can I select a new row in a dgv and clear the old selection as an atomic operation? I can do it in two statements but that results in the SelectionChangedEvent firing twice.

dgv.ClearSelection();
dgv.Rows[e.RowIndex].Selected = true;

It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies