Visual Studio 2008 DataGrid column width changing

30 Views Asked by At

I have a project for hand terminal and It use visual studio 2008. I want to change column width but I tried many things and It didn't work. Here is my example code for creating column

           col = table.Columns.Add();
            col.ColumnName = "Column1";
            col.DataType = typeof(string);
            col.Caption = "Column1";

How can I do that. I'm stuck

I tried some solutains

DataGridViewColumn column = dataGridView.Columns[0];
column.Width = 60;

gridName.Columns[0].FillWeight = 200;
gridName.Columns[1].FillWeight = 50;

when I write grid name It I can't do gridName.Column. This isn't work

0

There are 0 best solutions below