Now that I can see the data in the datagrid, I realize that the size of the fields is too small - the customerid and customer name fields both could use expanding so that I can see all of the text. Is there a way to programmatically extend the length of the field so that it can show the entire string?
bajanpoet
0
Junior Poster in Training
Recommended Answers
Jump to PostSomething like this?
It will expand the last column in the datagridview. You can edit it to your needs :=)Private Sub DataGridView1_DataBindingComplete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete Dim _DGV As DataGridView = DirectCast(sender, DataGridView) _DGV.Columns(_DGV.ColumnCount - 1).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill End Sub
All 4 Replies
4advanced
23
Junior Poster in Training
4advanced
23
Junior Poster in Training
rapture
134
Posting Whiz in Training
bajanpoet
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.