C#DataGrid查看打印机 [英] C# DataGrid View Printer
本文介绍了C#DataGrid查看打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此处的代码 来打印我的Windows窗体数据网格。我的问题是如何使行高高于默认高度?
看起来它没有显示我的链接,所以在这里是:
另一个DataGridView打印机 [ ^ ]
解决方案
似乎很容易实现:
printer.RowHeight = DGVPrinter.RowHeightSetting.CellHeight;
请按照文章的链接,转到最后找到评论和讨论部分。问一个问题;)
您可以使用 DataGridViewRow.Height [ ^ ]或 DataGridViewRow.MinimumHeight [ ^ ]属性。
DataGridViewRow row = dataGridView.Rows [ 0 跨度>];
row.Height = 15 ;
// 或
DataGridViewRow row = dataGridView.Rows [ 1 跨度>];
row.MinimumHeight = 40 ;
我实际上刚刚发现了如何设置数据网格的行高。我使用了这段代码:
dgvScheduler.RowTemplate.MinimumHeight = 30;
//只需将高度设置为你之后的任何值!
I am using the code found here to print my windows form datagrid. My question that I have is how can I make the row height greater than the default height?
It doesn''t look like it showed my link, so here it is:
Another DataGridView Printer[^]
解决方案
It seems to be simple to achieve:
printer.RowHeight = DGVPrinter.RowHeightSetting.CellHeight;
Please, follow the link to the article, go to the end of it to find Comments and Discussion section. There ask a question ;)
You can use DataGridViewRow.Height[^] or DataGridViewRow.MinimumHeight[^] property too.
DataGridViewRow row = dataGridView.Rows[0]; row.Height = 15; //or DataGridViewRow row = dataGridView.Rows[1]; row.MinimumHeight = 40;
I actually just discovered how to set the row height for a datagrid. I used this code:
dgvScheduler.RowTemplate.MinimumHeight = 30;
//And just set the Height to whatever value you are after!
这篇关于C#DataGrid查看打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文