Programatically select all rows in dataframe

Hello,

Is it possible to select all rows (or some rows) in a dataframe? Right now I have this code:

event = st.dataframe(
        df,
        use_container_width=True,
        hide_index=True,
        on_select="rerun",
        selection_mode="multi-row",
        height = min(((len(df) + 1) * 35 + 3), 350)
        )

Is it possible to have all the rows selected upon starting the dashboard?
I am aware of this way to show selections but I like the functionality of the given example.

There are some old threads similar to this, stating it was not possible, but if any of you know of some recent changes or tricks to do this, it’s highly appreciated!

Any suggestions are highly appreciated :slight_smile:

Not at this time. The selection events are read only so you can’t programmatically set them from the server side.

There are a couple feature requests you can upvote on GitHub:

1 Like

Thanks a lot!