Click here to Skip to main content
16,010,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

very simple

select backcolor of gridview as white

or you can set at coding time
dataGridView1.BackgroundColor = System.Drawing.Color.White;
 
Share this answer
 
This[^] could help.
 
Share this answer
 
set all this properties.......

MIDL
//
// 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;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900