在Devexpress gridview事件之后,数据未在主文本框中加载

时间:2013-02-21 12:06:21

标签: asp.net devexpress aspxgridview

您好我是devexpress gridview的新手。我在网格外有一个文本框(TotalDebit),我有一个devex gridview,我在其中插入,更新数据。在我的事件处理程序中,当我在gridview中插入新行时,我想计算总借记并显示在gridview外的主文本框中。我已经计算了总借记,但问题是它没有显示在gridview外的文本框中。这是代码:

public void grvDetail_RowInserting(objectsender,DevExpress.Web.Data.ASPxDataInsertingEventArgs e)     {

if(DetailTable.Rows.Count> 0)

           for (int i = 0; i < DetailTable.Rows.Count; i++)
           {

               if (DetailTable.Rows[i]["FlagDC"].ToString() == "D")
                   TotalDebit += Convert.ToDouble(DetailTable.Rows[i]["Amount"].ToString());
               else
                   TotalCredit += Convert.ToDouble(DetailTable.Rows[i]["Amount"].ToString());

           }

       txtDebit.Text = TotalDebit.ToString(); //textbox outside gridview
       txtCredit.Text = TotalCredit.ToString(); //textbox outside gridview

          }

1 个答案:

答案 0 :(得分:0)