Page 1 of 1

Blank DataGrid issue

Posted: Fri Nov 20, 2009 12:49 am
by massung
I've run into an issue where I was removing some images from the application (well, replacing them with new ones) and those images were being used on my datagrid. I removed the images from the datagrid template successfully and updated the code to not reference them. I clicked my "go" button to propogate the datagrid again and now I have a completely empty datagrid. As far as I can tell, the data is there and did get to the datagrid, just the controls aren't showing up.

If I close Rev and reload my stack, the following appears in the message box:
89,8418,50,dgAlternatingRows
77,8418,50
456,8418,38
380,8418,9
572,8418,1
253,8402,1
241,8402,1,_DrawAlternatingRows
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/Program Files/Revolution Enterprise/4.0.0-gm-1/Toolset/revdatagridlibrary.rev"
573,85,1
253,84,1
I assume that something's gone horribly wrong and that's debug output intended to help me, but I'm clueless as to what I need to do in order to fix this. I could resort to deleting the datagrid and rebuilding it, but there's a lot of scripts and controls in there that I'd rather not. Any help appreciated.

Thanks!

Jeff M.

Posted: Fri Nov 20, 2009 2:55 pm
by trevordevore
You are supposed to get an error dialog that tells you about the error. But since you aren't seeing one just wrap the code in your FillInData and LayoutControl handlers in try/catch statements.

Code: Select all

on FillInData
   try
       ...
   catch e
       put "error in " & param(0) &":" && e
   end try
end FillInData


on LayoutControl
   try
       ...
   catch e
       put "error in " & param(0) &":" && e
   end try
end LayoutControl
This should at least give you an error message that provides more information. Try that and let me know what is output to the Message Box.

Posted: Fri Nov 20, 2009 4:29 pm
by massung
Hey, Trevor.

I forgot to mention that I already had similar error catching code in both those functions. I changed what I had to match yours (just in case), but to no avail. There's no error messages that are getting spit out.

To be honest, while I don't get any messages, I can't even prove that the functions are getting called at all. Breakpoints don't work, and if I comment out all the code in them and just have

Code: Select all

put "here"
in each, nothing still happens. I don't know what would cause the methods to not even get called at all.

Any help/ideas appreciated. Thanks!

Jeff M.

Posted: Fri Nov 20, 2009 4:52 pm
by trevordevore
I just looked through the error message again and it looks like you deleted one of the image controls of the Data Grid itself when you were clearing out images. The image is named "dgAlternatingRows". Error 89 is "Chunk: no such object".

You could probably just copy the image from another data grid and add it to your existing data grid. Something like his might work:

Code: Select all

copy img "dgAlternatingRows" of group "DataGridWithImage" to group "DataGridWithoutImage"
The image is invisible and is usually near the back of the group. I'm not sure that the layer will cause any problems though.

Posted: Fri Nov 20, 2009 5:03 pm
by massung
It worked!

You just saved me a bunch of time. Thanks, Trevor!

Is there a webpage or anything that talks about the common datagrid errors/problems, fixes, how it is put together/works? I'm sure other issues will arise in the future, and I'd rather not bother anyone with them if I can fix them myself.

Thank you again.

Jeff M.