Datagridview Showing Blank Rows

0
0

Hello Wisej.

I have a datagridview on the main screen of my application, it is used all day by 4 or 5 people and works fine apart from sometimes (once every few days) a number of rows are all blank instead of showing data, this 15 second video shows the problem happening:

The expected behaviour is that all rows show data, there shouldn’t be any rows without data showing on them. The user can flick to another screen then back again and all the rows show data again. I can’t make it happen in my test environment so can’t send any example code to you so I understand this is not something that you can offer a definite solution for but am looking for any ideas as to what might be causing this problem and therefore what I can do to stop it happening.

Thank you

Andrew

  • You must to post comments
0
0

Now that I think about it, I have seen some similar before and it turned out to be an exception during the rendering of the rows. Those exceptions are logged but not displayed to the user. It could be a data error or a data formatting error.

You can enable logging to a file in web.config using

<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="myListener" 
          type="System.Diagnostics.TextWriterTraceListener" 
          initializeData="TextWriterOutput.log" />
        <remove name="Default" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

the file can get big and it will slow down a bit. You can also attach to the DataError event of the DGV to see if you get a hit.

 

in debug mode you can simply enable the exceptions in VS Debug->Exception Settings.

  • Andrew Pearce
    Thank you for the help Luca. I will try this and see if it helps me
  • You must to post comments
0
0

Going to another screen means switching browser tabs, or going to another application? Or do you mean another screen in the app?

It looks like there may be rows added in a background task?  Also check the chrome console to see if there are javascript error.

BTW, a great free chrome extension to record a web page is screencastify.

  • Andrew Pearce
    Hello Luca. Going to another screen means either closing and re-opening the window that contains the datagridview or simply causing a refresh of the datagridview – in this application this is done by clicking on another day on the calendar (top right of the screen shown in the video) – the application assigns the DataSource for the datagridview to a different List, when they click back to whichever day they were originally viewing the datagridview gets assigned to the original List again but this time all the rows look normal ie no blank sections. (thanks for the Screencastify idea, this video was sent to me by a user though so out of my control). Andrew
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.