locked
How to make specific cell(s) read-only in a data-grid RRS feed

  • Question

  • Hi there!

    Is there a way to make an specific cell read-only in a data-grid?

    Best regards,



    Ciro

    Friday, May 9, 2014 8:10 PM

Answers

  • Hi !

    After some months... here is the solution:

    Private WithEvents _gridTaste As DataGrid
    
            Private Sub MyScreen_Created()
    
                AddHandler FindControl("GridTaste").ControlAvailable,
                    Sub(s, e)
                        _gridTaste = CType(e.Control, DataGrid)
                    End Sub
            End Sub
    
            Private Sub _gridTaste_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs) Handles _gridTaste.BeginningEdit
                ' I want do set the cell (2,0) as read only:
                If e.Row.GetIndex = 2 AndAlso e.Column.DisplayIndex = 0 Then
                    e.Cancel = True
                End If
            End Sub

    I hope this post help you too!

    Best regards,


    Ciro

    • Marked as answer by Oric.CQ Friday, April 17, 2015 12:40 PM
    Friday, April 17, 2015 12:34 PM