白色DataGridView背景 [英] White DataGridView background

查看:111
本文介绍了白色DataGridView背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想在桌面应用程序中修改datagridview,使其看起来像没有行边框,列边框或单元格边框的白皮书.实际上,我想显示在datagridview中加载的数据作为报告.如果有人对此有所了解,请帮助我.


谢谢.

Hi there,

I want to modify datagridview in desktop application such that it should look like a white paper with no row borders or column border or cell borders. Actually i want to show data loaded in datagridview as a report. If someone have idea about it than please help me.


Thanks.

推荐答案

非常简单

选择gridview的背景色为白色

或者您可以在编码时设置
very simple

select backcolor of gridview as white

or you can set at coding time
dataGridView1.BackgroundColor = System.Drawing.Color.White;


[
This[^] could help.


设置所有这些属性..... ..

set all this properties.......

//
// dataGridView1
//
this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.ColumnHeadersVisible = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.GridColor = System.Drawing.Color.White;
this.dataGridView1.Location = new System.Drawing.Point(34, 183);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowTemplate.DefaultCellStyle.NullValue = null;
this.dataGridView1.RowTemplate.ReadOnly = true;
this.dataGridView1.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dataGridView1.Size = new System.Drawing.Size(557, 282);
this.dataGridView1.TabIndex = 17;


这篇关于白色DataGridView背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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