Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Posts
    165

    Grid operation failed

    Hello,
    Im having an error when trying to set a cell's text in a grid: Grid operation failed.
    Does someone have a solution or workaround for this. Or maybe an advice to search for the bug. Im sure the grid is editable. If not the case the program makes the grid editable.

    I think im tired and therefor don't see the error i've possibly made myself:
    Code:
    		totaal = 0
    		for x = 1, nRows-1 do
    		add = Grid.GetCellText("Grid1", x, e_Column);
    		add = String.ToNumber(add)
    		totaal = totaal + add
    		end
    		IsEditable = Grid.IsCellEditable("Grid1", nRows, e_Column);
    		if IsEditable == true then
    		Grid.SetCellText("Grid1", nRows, e_Column, ""..totaal.."", true);
    		elseif IsEditable == false then
    		Grid.SetEditable("Grid1", true);
    		Grid.SetCellText("Grid1", nRows-1, e_Column, ""..totaal.."", true);
    		Grid.SetEditable("Grid1", false);
    		end
    Totaal = dutch for total. So what this code part does is count all rows in a specific row together and store the output into the last cell in a row. the variable nRows id defined like this:
    Code:
    nRows = Grid.GetRowCount("Grid1");

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    What line gives you what error?


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Where are you calling this code from? e_Column is only available in the grid On Cell Changed and On Selection Changed events.

    The grid does not have to be editable in order to set the value of a cell from code. That only applies to allowing the user to type values into the cells.
    Dermot

    I am so out of here

  4. #4
    Join Date
    Apr 2007
    Posts
    165
    Code:
    totaal = 0
    		for x = 1, nRows-1 do
    		add = Grid.GetCellText("Grid1", x, e_Column);
    		add = String.ToNumber(add)
    		totaal = totaal + add
    		end
    		IsEditable = Grid.IsCellEditable("Grid1", nRows, e_Column);
    		if IsEditable == true then
    		Grid.SetCellText("Grid1", nRows, e_Column, ""..totaal.."", true);
    		elseif IsEditable == false then
    		Grid.SetEditable("Grid1", true);
    		Grid.SetCellText("Grid1", nRows, e_Column, ""..totaal.."", true);
    		Grid.SetEditable("Grid1", false);
    		end
    		
    		Dialog.Message("Notice", "totaal:"..totaal.."\nKolom:"..e_Column.."\nRij:"..nRows.."", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    There is no error on runtime actualy. When i look for an error when i use the application.getlasterorr or whatever the code was after the code above, and show it via a dialog it returned that error. the code above needs to count all values of a column together exept the last one and set the last row in that column to the value stored in the variable totaal. and on runtime it didnt do anything. So then i used the last line in the above code to display al values involved. and that was ok. Then i retrieved that error via application.getlasterorr or what it was and gave me that error.

    i called the code from the On Cell Changed event

Similar Threads

  1. Grid Selection Question
    By thisisauniqueusername in forum AutoPlay Media Studio 7.5
    Replies: 13
    Last Post: 10-24-2008, 09:29 AM
  2. Suggestions: Grid
    By bule in forum AutoPlay Media Studio 7.5 Suggestions
    Replies: 6
    Last Post: 08-05-2008, 08:40 PM
  3. Grid Question
    By ShadowUK in forum AutoPlay Media Studio 7.5
    Replies: 1
    Last Post: 07-23-2008, 04:40 PM
  4. Grid Problems
    By Solmos in forum AutoPlay Media Studio 7.5
    Replies: 2
    Last Post: 03-17-2008, 09:31 AM
  5. ERROR: Demo image failed CRC validation whe building
    By morpheuskc in forum Setup Factory 6.0
    Replies: 6
    Last Post: 01-17-2003, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts