dev gridcontrol控件中某列单元格值取值与赋值
2016-03-18 10:46
302 查看
不废话,直接上代码
for (int i = 0; i < gridView1.RowCount; i++)
{
decimal qmqty = Convert.ToDecimal(this.gridView1.GetRowCellValue(i,gridView1.Columns["期末数量"]));
int kunzs = Convert.ToInt32(this.gridView1.GetRowCellValue(i,gridView1.Columns["捆支数"]));
decimal mperz = Convert.ToDecimal(this.gridView1.GetRowCellValue(i, gridView1.Columns["米每支"]));
decimal zzl = Convert.ToDecimal(this.gridView1.GetRowCellValue(i, gridView1.Columns["支重量"]));
if (ckbh == "01")
{
int gdjianshu = Convert.ToInt32(qmqty / kunzs / mperz);
this.gridView1.SetRowCellValue(i, gridView1.Columns["jianshu"], gdjianshu.ToString());
}
else
{
int xcjianshu = Convert.ToInt32(qmqty / kunzs / zzl);
this.gridView1.SetRowCellValue(i, gridView1.Columns["jianshu"], xcjianshu.ToString());
}
}
for (int i = 0; i < gridView1.RowCount; i++)
{
decimal qmqty = Convert.ToDecimal(this.gridView1.GetRowCellValue(i,gridView1.Columns["期末数量"]));
int kunzs = Convert.ToInt32(this.gridView1.GetRowCellValue(i,gridView1.Columns["捆支数"]));
decimal mperz = Convert.ToDecimal(this.gridView1.GetRowCellValue(i, gridView1.Columns["米每支"]));
decimal zzl = Convert.ToDecimal(this.gridView1.GetRowCellValue(i, gridView1.Columns["支重量"]));
if (ckbh == "01")
{
int gdjianshu = Convert.ToInt32(qmqty / kunzs / mperz);
this.gridView1.SetRowCellValue(i, gridView1.Columns["jianshu"], gdjianshu.ToString());
}
else
{
int xcjianshu = Convert.ToInt32(qmqty / kunzs / zzl);
this.gridView1.SetRowCellValue(i, gridView1.Columns["jianshu"], xcjianshu.ToString());
}
}
相关文章推荐
- DevExpress获取节点下可视区域子节点集合的实现方法
- DevExpress实现TreeList父子节点CheckState状态同步的方法
- DevExpress实现TreeList向上递归获取公共父节点的方法
- DevExpress设置TreeList图片节点背景色的方法
- Android编程UI设计之GridView和ImageView的用法
- C#中GridView动态添加列的实现方法
- DevExpress实现TreeList按条件隐藏节点CheckBox的方法
- DevExpress实现GridControl根据列选中一行
- DevExpress实现GridControl同步列头checkbox与列中checkbox状态
- DevExpress实现GridControl列头绘制Checkbox的方法
- DevExpress中GridControl列转义的实现方法
- DevExpress实现禁用TreeListNode CheckBox的方法
- DevExpress实现TreeList节点互斥的方法
- Gridview用法大总结(全程图解珍藏版)
- C#使用RenderControl将GridView控件导出到EXCEL的方法
- asp.net gridview中用checkbox全选的几种实现的区别
- GridView使用学习总结
- 模仿美团导航栏分类布局
- GridView设置自动滚动到列表底部导致第一条数据不显示问题处理
- Android控件Gridview实现多个menu模块,可添加可删除