winform DataGridView 选择行 获取数据
2011-04-26 14:09
381 查看
private void WorkerGrid_SelectionChanged(object sender, EventArgs e)
{
this.WorkerGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
txtwid.Text = this.WorkerGrid.CurrentRow.Cells[0].Value.ToString();
this.txtwname.Text = this.WorkerGrid.CurrentRow.Cells[1].Value.ToString();
this.txtwcard.Text = this.WorkerGrid.CurrentRow.Cells[2].Value.ToString();
this.txtwphone.Text = this.WorkerGrid.CurrentRow.Cells[3].Value.ToString();
this.txtaddress.Text = this.WorkerGrid.CurrentRow.Cells[4].Value.ToString();
}
{
this.WorkerGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
txtwid.Text = this.WorkerGrid.CurrentRow.Cells[0].Value.ToString();
this.txtwname.Text = this.WorkerGrid.CurrentRow.Cells[1].Value.ToString();
this.txtwcard.Text = this.WorkerGrid.CurrentRow.Cells[2].Value.ToString();
this.txtwphone.Text = this.WorkerGrid.CurrentRow.Cells[3].Value.ToString();
this.txtaddress.Text = this.WorkerGrid.CurrentRow.Cells[4].Value.ToString();
}
相关文章推荐
- Winform的dataGridView 选择数据 更新 删除 右键 注意事项
- dataGridView操作数据(增加 读取 绑定 获取选择的单元格 选中整行单元格时颜色变换 更新数据 锁定列的位置 添加行 列头的方法)
- C#之DataGridView获取用户选择的行的数据...
- C#之DataGridView获取用户选择的行的数据...
- WinForm 2.0 无代码实现DataGridView数据和下拉框和文本框的同步
- 清除dataGridView中单元格数据(选择的任意行+列) 方法二
- c# winform DataGridView导出数据到Excel中,可以导出当前页和全部数据
- winform datagridview 定制用户数据
- 使用AutoCompleteExtender在服务器端获取提示数据提示客户选择
- C# winform中选择本地文件,并获取其路径
- [C#]Winform后台提交数据且获取远程接口返回的XML数据,转换成DataSet
- 如何获取DataGridView表格中的某个字段数据
- C# Winform DataGridView 获取数据源帮顶表行状态的一点教训
- 如何在winform中子窗体提交数据后刷新父窗体中的DataGRIDVIEW数据?
- .NET WinForm程序中给DataGridView表头添加下拉列表实现数据过滤
- c# winform DataGridView导出数据到Excel中,可以导出当前页和全部数据
- winform datagridview 获取当前单元格的行号,或者 是列号
- Winform DataGridView 插入一行数据
- c# winform DataGridView单击选中一整行,只能单选,不能选择多行,只能选择一行
- c# winform dataGridView 数据查询后不能刷新