DatagridView and Cell Controls

0
0

Hello,

I have a datagridview with few Columns containing Controls. (See attached Pics).

The datagidview is filled programmatically by a loop.

Initially it’s showing properly, but I have a button to manipulate the rows (clear all rows, then Fill again with a new set).

What happens is that after some utilization (in designer and IIS express, after 2-3 iteration on IIS 8), the Columns with Controls aren’t filled anymore.

The text columns are OK.

From there, the datagrid isn’t responding properly to the updates code (updated displayed rows, etc …)

Playing further, at some point brings the error message (Remove Error: …)

 

                    dataGridView1.BeginUpdate();
dataGridView1.SuspendLayout();
dataGridView1.Rows.Clear();

DS = _myLMORA01Db.Get_Started_Operations(SQLUNION, TIMERANGEWhere, STATUSWhere, CONFIRMWhere, WKCWhere, TIMERANGEWhere2, CONFIRMWhere2);
if (DS != null)
{
foreach (DataRow row in (System.Collections.IEnumerable)DS.Tables[0].Rows)
{
dataGridView1.Rows.Add(GetNew_DataG_Row(row));
}
}

DS.Dispose();
DS = null;

dataGridView1.ResumeLayout();
dataGridView1.EndUpdate();

The number of rows is varying between +- 20 and 100. Is the virtualmode required for such a small amount of rows ?

Any Idea ?

 

Wisej 2.0.28/Win10/VS2015

 

Regards

 

  • You must to post comments
0
0

What happens to the existing rows and cells with the control when you update the grid? Do you dispose the progressbar controls or let the GC collect them?

  • You must to post comments
0
0

Hi Luca,

Pressing F5 does display the grid.

The rows are cleared using dataGridView1.Rows.Clear(); and filled by the attached row_generation.txt file (simplified to 1 control)

In Wisej_error.log line 20348, you see the “Uncaught Error: Remove Error: wisej.web.PictureBox[undefined] is not a child of this widget!”

There are more of them in the log.

When no uncaught error is displayed, then have a look at the attached pictures Screenshot1 & 1b to see the response.

Once not displaying the controls, pressing the buttons on top of the screen to regenerate a new set of rows ends up with the messages from Screenshot 1 & 1b.

 

Best Regards.

  • You must to post comments
0
0

It’s probably an error on  the client that is blocking the update. See in console.

If you hit refresh, do you get the correct state on the client?

Don’t need to call Suspend/ResumeLayout().

How are the cell controls added/removed?

VirtualMode is not needed. That’s only to handle large data sets on the server. Nothing changed for the client since the wisej.web.DataGrid widget is always in virtual mode.

 

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.