wpf datagrid样式

| 我正在使用DataGrid在我的应用程序中打印出发票,但看起来一点也不好,例如,我不喜欢纸上的滚动条,它不能在纸上工作,可以有人指出我朝着正确的方向样式化我的数据网格吗? 现在,它看起来像这样,但是应该看起来像这样,嗯,不完全是,但是应该看起来像一张桌子,我敢肯定,您已经明白了。     
已邀请:
好吧,我不认为大多数控件都旨在使用它们进行打印。我会使用ms office interop来填充单词或excel \“ template \”并从那里打印...额外的优点:您不需要开发人员即可更改用作模板...秘书可以做到 但是,如果您想使用
DataGridView
进行此操作...这是我会尝试的方法(对不起... winforms ...也许您必须弄清楚对WPF项目进行哪些更改) 滚动条可见,因为控件的当前大小不允许绘制所有列空间->所有列的总宽度太大->尝试将DGV
AutoSizeColumnsMode
设置为
DisplayedCells
,将第一列columns3ѭ设置为
Fill
对于其他视觉方面:
dataGridView.BorderStyle = BorderStyle.None;
dataGridView.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
dataGridView.EnableHeadersVisualStyles = false;

ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.Color.White;
ColumnHeadersDefaultCellStyle.Font = new Font(\"Microsoft Sans Serif\", 9.75F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)));
ColumnHeadersDefaultCellStyle.ForeColor = Color.Black;
ColumnHeadersDefaultCellStyle.SelectionBackColor = Color.White;
ColumnHeadersDefaultCellStyle.SelectionForeColor = Color.Black;
    

要回复问题请先登录注册