SORU
8 NİSAN 2012, Pazar


Nasıl programlı olarak datagridview için yeni bir satır eklemek için

eğer datatable satır ekleyin

DataRow row = datatable1.NewRow();
row["column2"]="column2";
row["column6"]="column6";
datatable1.Rows.Add(row);

Nasıl DataGridView??

CEVAP
8 NİSAN 2012, Pazar


Yapabilirsiniz:

DataGridViewRow row = (DataGridViewRow)yourDataGridView.Rows[0].Clone();
row.Cells[0].Value = "XYZ";
row.Cells[1].Value = 50.2;
yourDataGridView.Rows.Add(row);

Ya da:

DataGridViewRow row = (DataGridViewRow)yourDataGridView.Rows[0].Clone();
row.Cells["Column2"].Value = "XYZ";
row.Cells["Column6"].Value = 50.2;
yourDataGridView.Rows.Add(row);

Düzenleme:

this.dataGridView1.Rows.Add("five", "six", "seven","eight");
this.dataGridView1.Rows.Insert(0, "one", "two", "three", "four");

Kimden: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.rows.aspx

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Art Food Kitty - Kelly Eddington

    Art Food Kit

    7 Kasım 2006
  • PhoneArena

    PhoneArena

    7 NİSAN 2006
  • Santozz Yazz

    Santozz Yazz

    23 Mart 2014