have created an AgGrid table on streamlit that allows user to select multiple rows. However,, I would like to limit the user to select up a certain amount of rows (e.g., 2). I was wondering if there us a way to do so? Here is my current code:
gd2 = GridOptionsBuilder.from_dataframe(df)
gd2.configure_pagination(enabled=True)
gd2.configure_selection(selection_mode="multiple", use_checkbox=True)
I think the best way if read the number of selected rows, and if it is more than 2, deselect the previous one. However, I am not sure how it can be implemented in Streamlit.