Hi,
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?
Tanks in advance
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
Hi Angelo,
what is the performance when you run your project inside Visual Studio in Release Mode?
Best regards
Frank
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.
– The form contains a custom datagridview.
– The form’s MyBase.Load event calls the ‘DGV_M_SetColumns‘ method which adds the columns to the grid:
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
– The MyBase.Shown event of the form calls the ‘FILL‘ method which essentially performs the binding of the grid:
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
Hi Angelo,
what does “open the form” actually mean? Open in the designer or running in debug mode inside Visual Studio?
Best regards
Frank
Please login first to submit.
