Search code examples
vb.netinfragistics

Infragistics grid combo box value change should disable cell of that specific row


I am using infragistics wingrid, I have column (EmploymentType) which is combobox has two values FullTime and Contract, If i have selected contract value for any specific row in grid, the Fringes column of that specific cell should be disabled. But i tried something here with below code, it works well but it's disabling whole Fringes column, instead it should disable specific cell of that fringes column. How can i do that.

Please find code below

    Private Sub ugMain_AfterCellListCloseUp(sender As Object, e As CellEventArgs) Handles ugMain.AfterCellListCloseUp
    If e.Cell.Column.Key = "EmploymentType" Then
        If e.Cell.Text = "Contract" Then
            e.Cell.Band.Columns("Fringes").CellActivation = Activation.Disabled
        Else
            e.Cell.Band.Columns("Fringes").CellActivation = Activation.AllowEdit
        End If
    End If
End Sub

Please find picture below

enter image description here


Solution

  • Try accessing the cells via the cell->row and settings its activation.

    e.Cell.Row.Cells("Fringes").Activation = Activation.Disabled