Good morning,
I'm building a table with 3 columns, add stuff into it, all good.
Later, I created a datagridview, bound the table to it with
$datagrid.datasource = $table
Looking at the datagridview, I see all the correct data. But the columns are not wide enough to display all the text, only partial text. I am unable to find a property to set the correct size of each column I wish to display.
how can I set the column size to suit my need?
Can someone help?
thanks!
load table to datagrid column size
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: load table to datagrid column size
The "Columns" collection has all column objects. Just set the width property as needed or use the autosize property.
Start here: https://www.sapien.com/blog/2020/09/08/ ... w-control/
I also recommend reading the whole article carefully and doing all of the samples and examples.
You should also take some time to review how WinForms and controls work as that will tell you how to find out how to use each control as intended making coding much easier.
Start here: https://www.sapien.com/blog/2020/09/08/ ... w-control/
I also recommend reading the whole article carefully and doing all of the samples and examples.
You should also take some time to review how WinForms and controls work as that will tell you how to find out how to use each control as intended making coding much easier.