GridViewDropDownCell SelectedChanged event

I add a GridViewDropDownCell in GridView, and I want to do something after the dropdowncell selectchanged. But I am not find the revelation event in GridView.
I have try to use AfterCellEdit event, but it seems to work before the dropdowncell text changed.
So I want to know is there any event after dropdowncell selectchanged ?

BoltGridView = GridView()
dropDownCell = Ansys.UI.Toolkit.GridViewDropDownCell()
DropDownItems = []
DropDownItems.append(GridViewDropDownCell.GridViewDropDownItem('Shank'))
DropDownItems.append(GridViewDropDownCell.GridViewDropDownItem('Screw'))
dropDownCell.AddItems(System.Array[GridViewDropDownCell.GridViewDropDownItem](DropDownItems))
dropDownCell.Text = 'Shank'
BoltGridView.Cells.SetCell(0, 0, dropDownCell)

Best Answer

  • 1990chs
    1990chs Member Posts: 34
    First Comment Name Dropper
    Answer ✓

    This is solved.
    From the args to get the StartRowIndex and type to do something after celledif

    def DropDownChanged(self, sender, args):
            text = args.Value
            Cell = args.Cell
            RowIndex = Cell.StartRowIndex
            CellType = Cell.GetType()
            if CellType == self.DropDownCell:
                ExtAPI.Log.WriteMessage('Here')
                if text == 'Shank':
                    self.Cells[RowIndex ,3].Text = ''
                    self.Cells[RowIndex, 3].BackColor = Ansys.Utilities.Palette.LightGray
                    self.Cells[RowIndex, 3].ReadOnly = True
                elif text == 'Screw':
                    self.Cells[RowIndex, 3].BackColor = Ansys.Utilities.Palette.White
                    self.Cells[RowIndex, 3].ReadOnly = False