forget_the_bright 1 year ago
parent 0480c4374c
commit 1bf10354c1

@ -226,7 +226,7 @@ namespace WindowsFormsApp1
}
string uidatagridview = textBox2.Text.Trim();
textBox1.Text = $"this.{uidatagridview}.AutoGenerateColumns = false;";
textBox1.Text += "List<DataGridViewColumn> cols = new List<DataGridViewColumn>();\n";
textBox1.Text += "List<DataGridViewColumn> cols = new List<DataGridViewColumn>();\n\n";
for (int i = 0; i < dt.Rows.Count; i++)
{
var Name = dt.Rows[i]["Name"].ToString();
@ -235,7 +235,7 @@ namespace WindowsFormsApp1
textBox1.Text += $"{Name}Cloumn.Name = \"{Name}\";" +
$"{Name}Cloumn.HeaderText =\"{IsNullable}\";" +
$"{Name}Cloumn.DataPropertyName = \"{Name}\";" +
$"cols.Add({Name}Cloumn);\n";
$"cols.Add({Name}Cloumn);\n\n";
}
textBox1.Text += "DataGridViewButtonColumn editBtn = new DataGridViewButtonColumn();\r\n" +
"editBtn.HeaderText = \"编辑\";\r\n" +

Loading…
Cancel
Save