إضافة اعمدة Columns إلى dataGridView1
private void btnAdd_Click(object sender, EventArgs e)
{
dataGridView1.ColumnCount = 11;
dataGridView1.Columns[0].Name = "ItemID";
dataGridView1.Columns[1].Name = "ItemName";
dataGridView1.Columns[2].Name = "Quantity";
dataGridView1.Columns[3].Name = "FreeQuantity";
dataGridView1.Columns[4].Name = "ItemUnitName";
dataGridView1.Columns[5].Name = "Price";
dataGridView1.Columns[6].Name = "TotalCost";
dataGridView1.Columns[7].Name = "Discount";
dataGridView1.Columns[8].Name = "Total";
dataGridView1.Columns[9].Name = "Notes";
dataGridView1.Columns[10].Name = "Delete";
dataGridView1.Rows.Add();
}
النتيجة:
أضف تعليق:
0 comments: