如何将任何gridview列添加到网格视图中。在c#windows应用程序中 [英] How do I can take addition of any gridview column into grid view. In c# windows application

查看:58
本文介绍了如何将任何gridview列添加到网格视图中。在c#windows应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的列名为total_prize我有10条记录。我想计算grid_view中所有产品的奖品也应该打印,因为我也希望打印成pdf,这个记录应该出现在grid_view中

为了打印目的我不能使用外部文本框/标签以加入其中。

解决方案

  int  sum =  0 ; 
foreach (GridViewRow row in nameofthegrid.Rows)
{
标签总和=(标签)row.FindControl( 要添加的项目模板中的列标签ID) ;
sum = sum + int.Parse(sum.Text);
TextBox1.Text = sum;
}



-values-in-grid / [ ^ ]

显示Gridview页脚中的总和(列值)[ ^ ]


I have column name total_prize i have 10 records . I want to calculate prize of all products present in grid_view also it should print because I also want to get print into pdf for this the record should present into grid_view
For Purpose of printing I can't use external textbox/label to get addition into it.

解决方案

int sum=0;
foreach (GridViewRow row in nameofthegrid.Rows)
{
 Label sum = (Label)row.FindControl(" column label id in item template to be add");
sum=sum+int.Parse(sum.Text);
TextBox1.Text=sum;
}


http://www.c-sharpcorner.com/UploadFile/rohatash/adding-values-in-column-and-sum-of-the-column-values-in-grid/[^]
To show the Sum of Total(Column Value) in Gridview Footer[^]


这篇关于如何将任何gridview列添加到网格视图中。在c#windows应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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