Make a cell read-only, except when a new row is created.
I want to be able to make a cell in a column read-only when I display the grid.
But if I add a row, I want the cell in that column to no longer be read-only.
Should this be handled in cellbeginEdit?
I read that you could use this line: e:row:isnewrow but it doesn’t compile.
Thank you for your feedback.
I want to be able to make a cell in a column read-only when I display the grid.
But if I add a row, I want the cell in that column to no longer be read-only.
Should this be handled in cellbeginEdit?
I read that you could use this line: e:row:isnewrow but it doesn’t compile.
Thank you for your feedback.
With a methode.
METHOD PRIVATE VOID CellBeginEdit(
INPUT sender AS System.Object,
INPUT e AS Telerik.WinControls.UI.GridViewCellCancelEventArgs ):
DEFINE VARIABLE iRow AS INTEGER NO-UNDO.
DEFINE VARIABLE iCol AS INTEGER NO-UNDO.
DEFINE VARIABLE isNewRow AS LOGICAL NO-UNDO.
DEFINE VARIABLE colName AS CHARACTER NO-UNDO.
DEFINE VARIABLE loCellEditor AS Telerik.WinControls.UI.RadTextBoxEditor NO-UNDO.
DEFINE VARIABLE editorElement AS Telerik.WinControls.UI.RadTextBoxEditorElement NO-UNDO.
ASSIGN iRow = e:ROW:Index
iCol = e:COLUMN:Index NO-ERROR.
IF ERROR-STATUS:ERROR OR iRow LT 0 THEN RETURN.
isNewRow = YES.
IF NOT isNewRow AND LOOKUP(e:COLUMN:NAME,ppcColKey) GT 0 THEN DO:
e:Cancel = TRUE.
RETURN.
END.