Announcement

Collapse
No announcement yet.

grid is full or empty; question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • grid is full or empty; question

    Hi I was reading and practicing the grid function and when I read this function

    count = Grid.GetRowCount("Grid1");

    I thought this was to get some info to see if grid if empty or not:

    Code:
    count = Grid.GetRowCount("Grid1");
    
    if count < 0 then
    Dialog.TimedMessage("Please Wait...", "okay!", 2000, MB_ICONINFORMATION);
    else
    Dialog.TimedMessage("Please Wait...", "This grid does not have any data", 2000, MB_ICONINFORMATION);
    end
    I didn't get any result when data is in instead the empty status. If empty displays grid does not have any data but wether its some data in the grid does not call to the dialog okay! Am I missing something?

  • #2
    I think its cos your using the Less than sign not the more then sign try
    if count > 0 then
    Plugins or Sources MokoX
    BunnyHop 2021 Here

    Comment


    • #3
      I think it depends on your definition of "empty". Grid.GetRowCount() simply returns the number of rows in the Grid. This does not mean that there is actually any data in the cells.

      I consider this an empty Grid, as there is no data, yet Grid.GetRowCount() returns correctly "3", as there are three lines:

      Click image for larger version

Name:	SCRN-2015-04-25-03.png
Views:	1
Size:	1.2 KB
ID:	284302

      Ulrich

      Comment


      • #4
        thanks for heads up Ulrich, I noticed my problem from not getting any data info when I run the code above was a setting properties for the grid. Changed the numbers of rows (before 0 now its 3).

        Thanks all again

        Comment

        Working...
        X