Dieter
October 2, 2024, 12:03pm
1
Hi all,
I like the dataframe component a lot, but I wonder how to specify that
I want to detect only single cell selections. I’m doing it like this
df = st.dataframe(
get_data_frame(),
on_select=selected,
hide_index=True,
key="df",
selection_mode=["single-column", "single-row"],
)
but this seems not to work.
Single cell selection events aren’t yet supported, but they are on the radar. You can upvote the GitHub issue to let our devs know it’s something to prioritize:
opened 01:20PM - 02 Jun 23 UTC
type:enhancement
feature:st.dataframe
area:events
### Problem
In the official tutorial about [`st.dataframe`](https://docs.stre… amlit.io/library/api-reference/data/st.dataframe#interactivity), it provides a well interactive UI, but it lacks one important feature: **indicate the selected `(row, column)`**.
For example:
```py
import streamlit as st
import pandas as pd
import numpy as np
df = pd.DataFrame(
np.random.randn(50, 20),
columns=('col %d' % i for i in range(20)))
st.dataframe(df)
```
We can change the last line to the following:
```py
row, column = st.dataframe(df)
```
And we can select a specific cell in the GUI:

Now we can do something with the selected row and/or column (in the above case: `row==4` and `column=="col 2"`). For example, we can show the detail info for the selected row.
---
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
**If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.**
Hi @mathcatsand , does that mean multi-cell selection events are supported, or are no cell selection events supported yet?
Only rows and columns can return selections at this time. Streamlit can’t identify a generic group of cells.
Individual cells can be selected by the user, but that’s just a frontend visualization that doesn’t return selection data to the Python backend.
Ok thank you, I’ve upvoted the GitHub issue you posted
system
Closed
April 16, 2025, 9:53am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.