vb.netdatagridview中如何换行?
答案:2 悬赏:0
解决时间 2021-11-15 09:24
- 提问者网友:逐野
- 2021-11-14 16:56
vb.netdatagridview中如何换行?
最佳答案
- 二级知识专家网友:都不是誰的誰
- 2021-11-14 17:48
If TextBox1.Text = "" And TextBox2.Text = "" And TextBox3.Text = "" Then
MessageBox.Show("请输入客户信息!")
Else
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(0).Value = TextBox1.Text
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(1).Value = TextBox2.Text
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(2).Value = TextBox3.Text
End If
MessageBox.Show("请输入客户信息!")
Else
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(0).Value = TextBox1.Text
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(1).Value = TextBox2.Text
DataGridView1.Rows(DataGridView1.Rows.Count-1).Cells(2).Value = TextBox3.Text
End If
全部回答
- 1楼网友:一池湖水
- 2021-11-14 19:15
c#的:但是道理应该相通!向你绑定的 datagridview的数据源添加一行新的
datatable dt = new datatable();
datacolumn dc = new datacolumn("name");
dt.columns.add(dc);
datarow dr = dt.newrow();
dt.rows.add(dr);
dt.rows[dt.rows.count - 1]["name"] = "要添加的数据";
然后重新用dt绑定datagridview
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯