Auto-fit grid columns using BestFitColumns()

Replaced manual column width settings for "GUID", "PROFILE_ID", and "EMAIL_SUBJECT" with gridView.BestFitColumns() to automatically adjust all column widths based on their content. This improves maintainability and ensures optimal display of data.
This commit is contained in:
OlgunR
2026-01-27 10:56:29 +01:00
parent 80b33eb3b2
commit 7ce7a11a30

View File

@@ -1068,15 +1068,7 @@ Public Class frmMain
Dim gridView = TryCast(Me.GridView5, DevExpress.XtraGrid.Views.Grid.GridView)
If gridView IsNot Nothing Then
gridView.OptionsView.ColumnAutoWidth = True
If gridView.Columns("GUID") IsNot Nothing Then
gridView.Columns("GUID").Width = 50
End If
If gridView.Columns("PROFILE_ID") IsNot Nothing Then
gridView.Columns("PROFILE_ID").Width = 50
End If
If gridView.Columns("EMAIL_SUBJECT") IsNot Nothing Then
gridView.Columns("EMAIL_SUBJECT").Width = 300
End If
gridView.BestFitColumns()
End If
Catch ex As Exception