Teqskater
10-23-2008, 11:54 AM
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:
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:
nRows = Grid.GetRowCount("Grid1");
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:
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:
nRows = Grid.GetRowCount("Grid1");