Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 Is there a way to set auto resize column only for particular column in DataGridView?

$
0
0
Hi all, I have a datagridview with 4 columns defined in it and i would like to set the auto resize column only for the 3rd and 4th columns only. This is because the data being added to these 2 columns are take place during run time and length of the string is not fixed. But for the 1st and 2nd column data string is fixed and thus, i want to keep these 2 columns size as small as possible because my GUI is running out of room.

I've tried to use the DGV.AutoResizeColumns(DataGridViewAutoSizeRowsMode.AllCells) but the 1st and 2nd columns size is still larger than i want.


Please advice.

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>