Add extra column to fill out space in datagridview C?

After databinding the DataTable to the DataGridView, set the desired column's AutoSizeMode to Fill.

After databinding the DataTable to the DataGridView, set the desired column's AutoSizeMode to Fill. DataTable dt = new DataTable("Table1"); dt.Columns. Add("A"); dt.Columns.

Add("B"); dt.Columns. Add("C"); dt.Rows. Add(1, 2, 3); this.

DataGridView1. DataSource = dt; this. DataGridView1.

ColumnsdataGridView1.Columns. Count - 1. AutoSizeMode = DataGridViewAutoSizeColumnMode.

Fill; You may also want to set the DataGridView to Anchor to the Right and Bottom sides of the form (as well as the left and top) so that the DGV gets bigger as the form is resized. (or set Dock to Fill).

Only reason I can see why this got downvoted is that it doesn't precisely answer the OP "how to add extra column" - even though it's an even better solution. :( +1 from me, anyway... – GalacticCowboy Dec 17 '08 at 17:46.

DataGridView1. ColumnCount = 3; dataGridView1. Columns0.Name = "data1"; dataGridView1.

Columns1. Name = "data2"; dataGridView1. Columns2.

Name = "data3"; find full source code here http://csharp.net-informations.com/datagridview/csharp-datagridview-add-column.htm gever.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions