DataGridView sorting by clicking on column header - page "locks up"

1
0

I haven’t had the time to dig into this deeply yet, but here’s the situation:  I’ve got a page that has six DataGridViews and other controls on it.  All of the DGVs support the default sorting behaviors – I haven’t changed any of the properties related to sorting from their defaults.  This is new work – nothing ported from VWG (which I have noticed sometimes leaves property settings around that cause misbehavior).

One of the six DGVs tends to cause the page to “lock up” – becomes unresponsive, eventually displays a WiseJ error that the page is not responding – when I click on column headers to sort the display.  The other 5 DGVs seem to be fine.

This DGV, like all of the others on the page, is data bound to a BindingSource which in turn is bound to a DataTable, all within a single DataSet.  There’s nothing particularly interesting about the columns – a DateTime, two strings and two decimals.  The two decimal columns allow nulls and most rows in fact contain nulls in these columns (actually, with the data I’m using to test, all of the rows contain nulls in these columns).

In practice, I can sort this DGV exactly once, e.g. by clicking on the Date header or either of the strings (I haven’t clicked on the number columns since they’re all null anyway).  When I try to sort a second time, e.g. by clicking the same column header again, the DGV contents are wiped out and the page is locked up.

I’ll keep digging – there’s clearly something different about this DGV or the data since the other 5 on the page don’t have this problem.  Meantime, any tips or known issues around DGV sorting are appreciated!

  • You must to post comments
0
0

I’m working on trying to make a repro for this issue – and wow does it ever repro.  In fact, it repros so much that I can’t even get to the point where the full app has problems.

I have a feeling that this is an automatic layout issue.  The page I’m testing has 7 DGVs and a number of FlexLayoutPanels, with nearly everything set to autosize and/or dock.Fill.  In my sample app, I can’t even insert a single row of data into the DGVs without the page locking up.

In this “locked up” state, the browser is using a small but consistent amount of CPU (about 1%);  iisexpress is not using and CPU, nor is devenv.exe, so it looks like it’s the browser itself – presumably the JavaScript engine – which is getting stuck.

Where can I send my repro application?  It’s a very stripped down version of the real application that I’m working on, so I do not want to post it publicly.

  • Julie (ITG)
    Please send your sample to support AT wisej.com. Please delete the /bin and /obj folders and do not include them in your sample. It is probably best to send the sample as a Google Drive folder instead of an email attachment so that it does not get blocked by the spam filter (also allows for larger file sizes). Thanks, Julie
  • Carl Daniel
    Thanks, Julie. In trying to narrow down the problem, I found that some of the bad behavior (that I was seeing in my repro, not in the real app) was due to invalid Unicode characters in strings that appear in DataGridView cells. Once I fixed up my bogus data to not include invalid Unicode characters, that problem went away. I’ll continue on my repro attempt and if I’m successful I’ll send a link to the email address above.
  • Carl Daniel
    I’ve got a consistent page hang when a DGV is docked in the upper pane of a horizontal Split container and the DGV has too many rows to fit in the viewport. I don’t know if that’s what’s happening in my “real” app, but it’s reproducible in this test app. I’ll package that app up and send it in later today unless I find a solution on my own.
  • Carl Daniel
    Repro sent!
  • You must to post comments
0
0

Hi Carl,

if you can wrap up the DGV that has these issues in a test case, we can take a look.
Otherwise it’s impossible from here to guess why it behaves in a different way compared to the other 4.

Best regards
Frank

  • Carl Daniel
    Hi Frank – I have a sneaky suspicion that I would not be able to make a small repro, but if I have time to look further, I will. Interestingly, this only happened while running a debug build on IIS Express, under the debugger or not. The finished app running on IIS (same browser – Edge in both cases) does not have this problem. which makes it feel like some complicated environmental issue.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.