KBell
KBell

Reputation: 511

How to make a specific cell in Janus GridEx to be not editable

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.

Upvotes: 0

Views: 1929

Answers (1)

KBell
KBell

Reputation: 511

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.

Upvotes: 2

Related Questions