本文介绍了发生mscorlib.dll错误时发生未处理的“System.StackOverflowException”类型异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
收到错误未绑定表达式。我创建了一个新专栏&运行时无界表达式。我从gridview获取特定的单元格值(GetRowCellValue)并尝试使用新值(SetRowCellValue)更改该未绑定的表达式列。但错误显示我的错误?帮助我。
这是我的代码。
Am getting error Unbound Expression. I Created a new column & Unbounded Expression on Runtime. I get a particular cell values(GetRowCellValue) from gridview and try to change that unbound expression column with new value(SetRowCellValue). But error shown whats my mistake ? Help me.
This is my Code.
private void gridView1_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
{
GridView view = sender as GridView;
if (e.Column.FieldName == "PriceQuantity" && e.IsGetData)
{
//e.Value = getTotalValue(view, e.ListSourceRowIndex);
calfun();
}
else
{
// nothing
}
}
private void calfun()
{
if (gridView1.FocusedRowHandle >= 1)
{
string temp = "Discount";
//string dis = TXE_Gettype.Text.ToString();
object objec = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Type"]);
string dis = objec.ToString();
if (dis == temp)
{
object obj = gridView1.GetRowCellValue(gridView1.FocusedRowHandle - 1, gridView1.Columns["Each"]);
int aa = Convert.ToInt32(obj);
//textEdit1.Text = aa.ToString();
object obj1 = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Each"]);
int a = Convert.ToInt32(obj1);
int b = aa;
int c = a * b;
//textEdit2.Text = c.ToString();
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["PriceQuantity"], c);
}
}
else
{
}
}
推荐答案
private void gridView1_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e) {
GridView view = sender as GridView;
if (e.Column.FieldName == "Total" && e.IsGetData)
e.Value = getTotalValue(view, e.ListSourceRowIndex);
}
这篇关于发生mscorlib.dll错误时发生未处理的“System.StackOverflowException”类型异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!