打印网格视图的选中行 [英] Printing checked rows of a gridview
本文介绍了打印网格视图的选中行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在gridview中使用复选框列.我的网格从数据库加载数据.我希望从网格中检查的行仅应打印,而不是所有行.请问有人可以给我一些提示吗?
我知道它可能看起来像这样:
foreach (GridViewRow row in GridView1.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox chkPrint = (CheckBox)row.Cells[1].FindControl("chkPrint"); if (chkPrint != null) { if (chkPrint.Checked) { // Hints of what should I do // } } } }
解决方案
我没有收到有关要打印的内容的问题?您要在实体页面还是浏览器页面上使用它?
如果您想将其打印在物理页面上,那么我认为可以从gridview
源中找到对checkbox
进行检查的记录,并进一步以编程方式制作HTML表并进一步打印该表.
而且,如果您想在浏览器页面中打印它,那么我认为这不是一件难事.
此处 [解决方案I am not getting your question on what you want to print? do you want it on physical page or browser page ?
If you want to print it on physical page then I think find a records fromgridview
source wherecheckbox
is checked and further make a HTML Table programatically and print that table further.
And If you want to print it in browser page then I think it isn''t a hard thing.
Here''s[^] a article which will lead you through this.
这篇关于打印网格视图的选中行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文