I have a datagridview that when it loaded first row is selected. I want to delete a record but I don't want first row select. I want message to user that first select a row then click delete button. I try these code but they don't worked.
//kharidDataGridView.Rows[0].Selected = false; //kharidDataGridView.ClearSelection(); //kharidDataGridView.CurrentCell = null; I use below codes in WPF:
object item = datagrideview1.SelectedItem; if (item == null) { //message to user } thank you