St_aggrid

Using Streamlit Aggrid and searching for a way to limit editing to specific columns versus all of them.
code snippet:

gd = GridOptionsBuilder.from_dataframe(df)
gd.configure_pagination(enabled=True, paginationAutoPageSize=True,paginationPageSize=10)
gd.configure_default_column(editable=True, groupable=True)
gd.configure_selection(selection_mode="multiple", use_checkbox=True)
gridoptions = gd.build()

Anyone out there able to provide some guidance will be greatly appreciated.

Thanks

2 Likes

Hi @dbaOnTap, you could replace your default column line with the following:

gb.configure_column(your_read_only_col_name, editable = false)

Add the above line for all the columns you want as read only.

Similarly, set the editable parameter to true for all the columns you want to be able to edit.

Cheers

2 Likes

LThanks! That did it.