DataGrid Column AutoSizemode = Fill doesn't (always) work

0
0

Hi,

Attached an Issue I ran into while loading a DatagridView at runtime while also setting their column properties.

 

To reproduce (attached is a sample):

  1. Add a DatagridView to a page
  2. at page load:
  3. Private Sub Page1_Load(sender As Object, e As EventArgs) Handles Me.Load
    DataGridView1.Columns.Add(“P_ID”)
    DataGridView1.Columns.Add(“Message”)
    DataGridView1.Columns.Add(“SenderName”)
    DataGridView1.Columns.Add(“SendDate”)For a As Integer = 1 To 10
    DataGridView1.Rows.Add(a, “I should be filled no?”, “Admin”, Now.ToString)
    Next

    With DataGridView1

    With .Columns(“P_ID”)
    .Visible = False
    End With

    With .Columns(“Message”)
    .HeaderText = “Bericht”
    .AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
    .MinimumWidth = 300
    End With

    With .Columns(“SenderName”)
    .HeaderText = “Door”
    .AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells

    End With

    With .Columns(“SendDate”)
    .HeaderText = “Datum”

    .AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells

    End With

    End With
    End Sub

  4. Run

Column “Message” should have the maximum available width but it is stuck at 300. If I were to add the columns at design time and set these properties the grid seems to work fine.

I’m running the 3.5.15-Preview

 

Thanks

Vincent

  • You must to post comments
0
0

Hi Vincent,

This issue is fixed in our latest release (Wisej.NET 3.1.5)!

Best,
Alaa

//

  • vincent_
    Thank you! It wasn’t mentioned in the buglist and I never heard anything so I assumed it wasn’t handled. You guys are awesome!
  • You must to post comments
0
0

Any update on this?

Thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.