可以做到双击某行,弹出对话框,对某条记录进行修改
完成后,刷新DataGrid
完成后,刷新DataGrid
解决方案 »
- 在GridView中如何格式化数字?把数据格式化为两位小数,每三位用","分开,如11115678.02456转化为:11,115,678.02 谢谢!
- winform中的datagridview控件有行绑定事件吗?
- 如何依次读取一个字段中的值?
- 无法将类型“System.Windows.Forms.Control”转换为“System.Windows.Forms.ToolStripSplitButton”
- 关于C#执行Command的问题
- CookieContainer.Add时产生NullReferenceException错误
- 求思路
- 请教C#中使用chart的问题
- socket异步传送大文件(200M)出现的问题,buffer小点能成功,buffer大点就失败,是什么问题
- 一个水晶报表的问题,是高手请进,答完给分
- winform中,DataGrid中数据的个性如何保存到数据库??
- Push模式下的水晶报表,为什么总是空白的报表?dataset填充到.rpt文件,在.rpt文件中需要拉字段出来吗?
dataGrid1[dataGrid1.CurrentRowIndex,i]可以得到某一个cell中的值,其中i为列号。
关于DataGrid的用法见:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp
DataTable dt = (DataTable) this.dataGrid1.DataSource;
DataRow dr = dt.Rows[this.dataGrid1.CurrentRowIndex);
But if the grid has been sorted, you can no longer get at the current row in the table through the grid's CurrentRowIndex. But for both unsorted and sorted grids, you can get at the current row through the BindingContext and the Current property of the BindingManagerBase.
[C#]
BindingManagerBase bm = this.dataGrid1.BindingContextr[this.dataGrid1.DataSource, this.dataGrid1.DataMember];
DataRow dr = ((DataRowView)bm.Current).Row;
双击问题见:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q869q