You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a few weeks now, I've been developing with the following environments:
VS 2022;
Wisej 3.5
NET framework 4.8
I have datagridviews with columns that I add manually and with the autogeneratecolun option. The grid is bound to the datasource.
I've noticed that in debug mode, opening the form sometimes takes up to 10 seconds. If the application is published on an IIS server, everything works smoothly.
From my tests, it seems to be due to the manual configuration of the columns.
From research, I've read that the problem could be caused by iisexpress, which is slower with newer versions of Wisej.
Any suggestions?
In summary, I noticed that the 'DGV_M_SetColumns' method slows down the form display (up to 10 seconds). In fact, if it's commented out (and I don't call it), the form displays quickly. However, this only happens when running with Visual Studio (IISExpress). If the application is deployed on a server (IIS), everything works without any delays.
Gabriele1 Del Giovineanswered2025-12-05 07:45:18 UTC
You don’t have to load the datagridview in the Show event handler.
Place (or call) the grid columns definition into the form constructor method or into the Load event handler. Also the call the data retrieval/databinding actions into the form Load event handler. So please check the autosize mode of you datagridview. If there are great number of rows into the datagridview datasource the automatic size require extra time to find the max widht of every column scanning every row….
I’ve tried all of Gabriele’s suggestions, but the problem persists. As mentioned, the slowdown only occurs when the application runs in VB.net debug, i.e., with IISExpress. If deployed on any server, i.e., IIS, everything runs smoothly. I don’t know if it’s a problem with my PC, Visual Studio, Wisej, or some setting in IIS Express. Any suggestions?
Activity
itg-assistant commentedon Jun 17, 2026
Frank (ITG) answered 2025-12-03 15:19:41 UTC
Hi Angelo,
what does "open the form" actually mean? Open in the designer or running in debug mode inside Visual Studio?
Best regards
Frank
itg-assistant commentedon Jun 17, 2026
Angelo Bordonaro answered 2025-12-04 15:50:00 UTC
Hi Frank,
When Running in debug mode inside Visual Studio.
If it helps, I'll briefly describe what the software does when the form opens.
Typical code for adding a column
txtC = New ASNetL.Wsj3.Forms.wDataGridViewTextBoxColumn
FieldName = "prfvcl_targa"
With txtC
.Name = FieldName
.DataPropertyName = FieldName
.HeaderText = "PLATE"
.Width = 150
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
.DefaultCellStyle.Format = ""
.ToolTipText = "Vehicle License Plate"
.Visible = True
.FilterEnable = True
.EditModeOnGrid = ASNetL.Wsj.wEnum.EditModeOnGridEnum.NoEditable
'I add the column to the grid
DGV_M_GRD.Columns.Add(txtC)
End With
PgSQL_Conn = New NpgsqlConnection(ConnStr)
PgSQL_Conn.Open()
DgvData.Clear()
PgSQL_Command.Connection = PgSQL_Conn
PgSQL_Command.CommandText = qry + WhereFlt
PgSQL_Adapter.SelectCommand = PgSQL_Command
PgSQL_Adapter.Fill(DgvData)
dgvBindingSource.DataSource = DgvView
dgv.AutoGenerateColumns = False
dgv.DataSource = dgvBindingSource
In summary, I noticed that the 'DGV_M_SetColumns' method slows down the form display (up to 10 seconds). In fact, if it's commented out (and I don't call it), the form displays quickly. However, this only happens when running with Visual Studio (IISExpress). If the application is deployed on a server (IIS), everything works without any delays.
Tanks
itg-assistant commentedon Jun 17, 2026
Frank (ITG) answered 2025-12-04 17:52:12 UTC
Hi Angelo,
what is the performance when you run your project inside Visual Studio in Release Mode?
Best regards
Frank
itg-assistant commentedon Jun 17, 2026
Angelo Bordonaro answered 2025-12-05 06:51:59 UTC
Hi Frank,
In *Release Mode *I have the same performance.
I notice that the problem is when then form create the columns on the grid for the first time.
In fact, if instead of closing the form, I execute the 'Hide' method and subsequently 'Show' the problem does not occur.
Best regards
Angelo
itg-assistant commentedon Jun 17, 2026
Gabriele1 Del Giovine answered 2025-12-05 07:45:18 UTC
You don’t have to load the datagridview in the Show event handler.
Place (or call) the grid columns definition into the form constructor method or into the Load event handler. Also the call the data retrieval/databinding actions into the form Load event handler. So please check the autosize mode of you datagridview. If there are great number of rows into the datagridview datasource the automatic size require extra time to find the max widht of every column scanning every row….
itg-assistant commentedon Jun 17, 2026
Frank (ITG) answered 2025-12-09 14:33:00 UTC
Thanks Gabriele, these are good points. Did you try to move your code from the Show Event handler, Angelo? Best regards, Frank
itg-assistant commentedon Jun 17, 2026
Angelo Bordonaro answered 2025-12-11 06:42:20 UTC
I’ve tried all of Gabriele’s suggestions, but the problem persists. As mentioned, the slowdown only occurs when the application runs in VB.net debug, i.e., with IISExpress. If deployed on any server, i.e., IIS, everything runs smoothly. I don’t know if it’s a problem with my PC, Visual Studio, Wisej, or some setting in IIS Express. Any suggestions?