0

In my VB.net application I have a Janus GridEx (v.3).

By default, each cell of each row is editable. But in certain conditions, I want a specific cell to be set to ReadOnly (or someting that unset the edit mode for this cell) during RowLoadEvent.

I know how to make an entire column not selectable (and how to get a specific cell) with :

e.Row.Cells("IndiceNew").Column.Selectable = False

But the only properties I can set are related to format (image, colors...). Any tips ? Thanks in advance.

4

1 回答 1

2

I finally found a way to do it. So here is what I did if it may help someone facing the same problem.

Instead of doing at LoadRowEvent time, I just cancel edit event during EditingCellEvent with something like :

Dim myDataSetRow As myDataSet.DataSetRow
myDataSetRow = CType(myGrid.GetRow().DataRow, DataRowView).Row

If Not myDataSetRow.IsIndiceModifiable Then 'the condition to check
    e.Cancel = True 'cancel edition
End If

Hope it can help someone in the future.

于 2019-01-29T16:49:05.980 回答