Hello everyone,
I am able to select a range with gb.configure_grid_options(enableRangeSelection=True).
However I need range selection only in one column (say column “Name”) and not the others.
Please guide how can I achieve this.
My current script looks like this…
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid, GridOptionsBuilder
# Create a small sample dataframe
data = pd.DataFrame(
{
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 22],
"Salary": [50000, 60000, 55000],
}
)
gb = GridOptionsBuilder.from_dataframe(data)
gb.configure_grid_options(enableRangeSelection=True)
gridOptions = gb.build()
# Display the dataframe using AG Grid
AgGrid(data, height=400, gridOptions=gridOptions, key="a")