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 = []
dropDownCell.Text = 'Shank'
BoltGridView.Cells.SetCell(0, 0, dropDownCell)

Best Answer

  • 1990chs
    1990chs Member Posts: 43
    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:
                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


  • Felix
    Felix Member Posts: 3
    Name Dropper First Comment

    Hi @1990chs
    Have you found which event can be used with the gridviewdropdowncell?
    I'm struggling with that as well...