【问题标题】:How to make a specific cell in Janus GridEx to be not editable如何使 Janus GridEx 中的特定单元格不可编辑
【发布时间】:2019-01-29 14:56:26
【问题描述】:

在我的 VB.net 应用程序中,我有一个 Janus GridEx (v.3)。

默认情况下,每行的每个单元格都是可编辑的。但在某些情况下,我希望在RowLoadEvent 期间将特定单元格 设置为ReadOnly(或取消设置该单元格的编辑模式)。

我知道如何使整个列不可选(以及如何获取特定单元格):

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

但我可以设置的唯一属性与格式(图像、颜色...)有关。 有小费吗 ?提前致谢。

【问题讨论】:

标签: .net vb.net winforms janus gridex


【解决方案1】:

我终于找到了办法。如果它可以帮助面临同样问题的人,这就是我所做的。

我没有在LoadRowEvent 时间做,而是在EditingCellEvent 期间取消编辑事件,例如:

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

希望它可以帮助将来的人。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多