Skip to content
Discussion options

You must be logged in to vote

You can get the row and column keys using the line below...

row_key, col_key = dt.coordinate_to_cell_key(dt.cursor_coordinate)

I remove the selected row in a project of mine using the function call below. Please note, I'm using self as a have a custom subclassed DataTable.

def action_remove_row(self) -> None:
    """Delete the currently selected row."""
    if not self.row_count:
        return
    row_key, _ = self.coordinate_to_cell_key(self.cursor_coordinate)
    self.remove_row(row_key)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pawamoy
Comment options

Answer selected by pawamoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants