Datagridview作为在计费项目中创建账单的模板 [英] Datagridview as templet for creating a bill in billing project

查看:58
本文介绍了Datagridview作为在计费项目中创建账单的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Experts

我正在开发计费软件.我需要使用datagridview创建帐单.
1.它将具有诸如项目编号,费率,数量,总计,总计之类的字段.账单将随后在数据库中更新.

我该如何使用datagridview.

2.我希望速率和数量一填满,总计(即速率*数量)应出现在该行的合计字段中,最后的合计总额将自动更新.


问候
Yogesh

Hi Experts

I am developing a billing software. What i need is to use datagridview to create a bill.
1. It will have fields like item no ,rate , qty , total, grand total. the bill will then be updated in database.

How can i do this with datagridview.

2. i want that as soon as rate and qty is filled total(i.e rate * qty) should appear in the total field on that line and grand total at the end be updated automatically.


Regards
Yogesh

推荐答案

在gridview的RowDataBound事件中,将代码以倍数的质量和比率编写,并置于总列中
示例:

In the RowDataBound event of gridview write the code to multiple the quality and rate and place in the total column
Example:

protected void gridClientList_RowDataBound(object sender, GridViewRowEventArgs e)
       {
           try
           {
               if (e.Row.RowType == DataControlRowType.DataRow)
               {
                   Label lblTotal = (Label)e.Row.FindControl("lblTotal");
                   lblTotal.Text = (DataBinder.Eval(e.Row.DataItem, "Rate")) * (DataBinder.Eval(e.Row.DataItem, "qly"));
               }
           }
           catch{}
      }



其中lblTotal是总计"标签的ID.



where lblTotal is the id of the Total label .


HI

我正在使用Datagridview而不是gridview.会起作用吗
HI

I am using Datagridview not gridview. will it work


这篇关于Datagridview作为在计费项目中创建账单的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆