[Solved] make a cell read-only, except when creating a new row

1 Answer 18 Views
GridView
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
Laurent asked on 09 Jun 2026, 04:17 PM
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.
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
commented on 09 Jun 2026, 04:20 PM | edited

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 = e:row:isnewrow. <== don't compile = error      .

 

  
        IF NOT isNewRow AND LOOKUP(e:COLUMN:NAME,ppcColKey) GT 0 THEN DO:
           e:Cancel = TRUE.
           RETURN.
        END.

                                                                 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 10 Jun 2026, 01:34 PM

Hello, Laurent,

Yes, you are on the right direction - you  can use the CellBeginEdit event to achieve desired behavior.

Use the following code snippet:

this.radGridView1.CellBeginEdit += RadGridView1_CellBeginEdit;

private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    if (!(e.Row is GridViewNewRowInfo))
        e.Cancel = true; // Cancel the edit operation to make the grid data cells not editable while be able to edit the new row
}

Note, I am providing the code in C# as it is our official programming language for support services, feel free to convert it to ABL as I suppose you are working in OpenEdge environment.

I hope this helps. Let me know if you have any other questions.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Modernizing a WinForms application? Use the AI-powered WinForms Converter to simplify migration to Telerik UI for WinForms.
Tags
GridView
Asked by
Laurent
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or