joe joe - 2 months ago 13
Vb.net Question

Using a boolean to determine whether a certain UltraGrid column is the active column

I need to call a subroutine only when a certain

UltraGridColumn
is active.
In the
CellListSelect
method, I'm trying to do something along the lines of

If UltraGrid.Rows(0).IsActiveColumn("my_Column") = True Then
subroutine(parameters)
Else
End If


But I've been unable to work out the correct way of doing this. Does it require a separate subroutine? Or can it be done in the format described?

Answer

I presume that your code is in the CellListSelect event handler, so you can write

if e.Cell.Column.Key = "my_Column") Then
    MessageBox.Show("my_Column")

    ....

End If

Being e the name of the instance of then CellEventArgs parameter passed to CellListSelect