Jump to content


Photo

Grid painting problem


  • Please log in to reply
6 replies to this topic

#1 m610

m610
  • Members
  • 33 posts

Posted 22 June 2009 - 07:08 AM

I am using a grid to display results as they come in over a serial or Ethernet port. Every so often the grid does not paint and on of the cells in a row, or some of the cells of the cells in the row, or only part of a cell may be painted. Either part or all of the cell is empty. It seems to happen when something else in the system interupt my program.

When I pass another form over the grid these cells do paint. Is there a way I can make sure the grid paints each row of cells after my program is done giving it the new values?


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 22 June 2009 - 04:20 PM

Hi,

I am not sure that I understand a question. Can you please send me a small demo project to I test it.

Also, maybe calling RefreshCell may help?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 m610

m610
  • Members
  • 33 posts

Posted 22 June 2009 - 08:15 PM

QUOTE (Boki (Berg) @ Jun 22 2009, 08:20 AM) <{POST_SNAPBACK}>
Hi,

I am not sure that I understand a question. Can you please send me a small demo project to I test it.

Also, maybe calling RefreshCell may help?

Best regards


A demo might not be that easy, but here's the code I use to write to the grid:
CODE
  NextGrid1.AddRow(1);
  NextGrid1.Cell[0,NextGrid1.RowCount-1].AsString:=FormatDateTime('hh:mm:ss.zzz',T);
  NextGrid1.Cell[1,NextGrid1.RowCount-1].AsString:=FloatToStrF(deltaT0,ffFixed,6,3);
  NextGrid1.Cell[2,NextGrid1.RowCount-1].AsString:=FloatToStrF(deltaT1,ffFixed,6,3);
  NextGrid1.Cell[3,NextGrid1.RowCount-1].AsString:=FloatToStrF(deltaT2,ffFixed,6,3);
  NextGrid1.Cell[4,NextGrid1.RowCount-1].AsString:=FilterInput(S1);
  NextGrid1.Cell[5,NextGrid1.RowCount-1].AsString:=FilterInput(S2);
  NextGrid1.Cell[6,NextGrid1.RowCount-1].AsString:=FilterInput(S3);
  NextGrid1.Cell[7,NextGrid1.RowCount-1].AsInteger:=IValue;
  NextGrid1.Cell[8,NextGrid1.RowCount-1].AsString:=FloatToStrF(FValue,ffFixed,6,Fmt);
  NextGrid1.ScrollToRow(NextGrid1.LastAddedRow);


and attachment Attached File  CNi_03.jpg   465.66KB   8 downloads is a screen show showing what it looks like.




#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 22 June 2009 - 09:33 PM

Hi m610,

Your code looks fine, I am not sure how can I help. Can you tell me is cell refreshed when you move Form outside the screen and turn it back?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 m610

m610
  • Members
  • 33 posts

Posted 22 June 2009 - 09:44 PM

QUOTE (Boki (Berg) @ Jun 22 2009, 01:33 PM) <{POST_SNAPBACK}>
Hi m610,

Your code looks fine, I am not sure how can I help. Can you tell me is cell refreshed when you move Form outside the screen and turn it back?

Best regards


I haven't written any code to refresh cells, or even the form. Windows is probably handling all that.

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 22 June 2009 - 10:04 PM

Hi m610,

I will like to know what happens if you manually refresh "empty" cells (for example move other window above). Does data is shown then?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 m610

m610
  • Members
  • 33 posts

Posted 25 June 2009 - 10:18 PM

QUOTE (Boki (Berg) @ Jun 22 2009, 02:04 PM) <{POST_SNAPBACK}>
Hi m610,

I will like to know what happens if you manually refresh "empty" cells (for example move other window above). Does data is shown then?

Best regards


Sorry for the delay in responding. Yes, the cells refresh when I pass another form over them.

The "Refresh" command fixed the problem. "RefreshRow" did not.

I noticed that this never happened until enough rows had been created for the ScrollRow command to start doing anything, but then again this doesn't happen that often and so waiting for that many rows to be created might not be long enough for the error to occur.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users