Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
DataGridView Sağ Tuş İle Kayıt Seçme
#1
Merhaba arkadaşlar,

DataGridView üzerindeki verilerde sağ tuş yapınca otomatik olarak satırı seçili hale getirmek isterseniz aşağıdaki kodlardan faydalanabilirsiniz.


DataGridView nesnenizin MouseDown yordamına;

Kod:
 private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
       {
           if (e.Button == MouseButtons.Right & dataGridView1.RowCount>0)
           {
               var hti = dataGridView1.HitTest(e.X, e.Y);
               dataGridView1.ClearSelection();
               dataGridView1.Rows[hti.RowIndex].Selected = true;
           }
       }
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  C# dataGridView'den PDF Dosyasına Veri Aktarma root 3 11,806 26-12-2016, 19:45
Son Yorum: root
  C# dataGridView'den TXT Dosyasına Veri Aktarma root 0 7,007 06-04-2016, 15:09
Son Yorum: root
  C# dataGridView'den Exel'e Veri Aktarma root 0 5,253 06-04-2016, 14:53
Son Yorum: root

Hızlı Menü:


Konuyu Okuyanlar: 1 Ziyaretçi