@@ -1239,18 +1239,34 @@ def build_grid_config( # pylint: disable=too-many-arguments
12391239 elif isinstance (row_selection , dict ):
12401240 row_sel_dict = row_selection
12411241
1242+ # Normalize user-provided grid options and consume rowSelection aliases.
1243+ # This prevents duplicate keyword errors when both row_selection param and
1244+ # grid_options['rowSelection'] are present.
1245+ normalized_grid_options = dict (grid_options or {})
1246+ grid_opt_row_selection = normalized_grid_options .pop ("rowSelection" , None )
1247+ if grid_opt_row_selection is None and "row_selection" in normalized_grid_options :
1248+ grid_opt_row_selection = normalized_grid_options .pop ("row_selection" )
1249+
1250+ # Precedence:
1251+ # - Explicit row_selection argument (True / dict / RowSelection) wins.
1252+ # - If row_selection is False (default) and grid_options specifies rowSelection,
1253+ # honor grid_options to preserve caller intent.
1254+ final_row_selection = row_sel_dict
1255+ if row_selection is False and grid_opt_row_selection is not None :
1256+ final_row_selection = grid_opt_row_selection
1257+
12421258 options = GridOptions (
12431259 columnDefs = col_defs ,
12441260 defaultColDef = DefaultColDef ().to_dict (),
12451261 rowData = row_data_for_grid ,
12461262 rowModelType = row_model_type ,
1247- rowSelection = row_sel_dict ,
1263+ rowSelection = final_row_selection ,
12481264 domLayout = "normal" ,
12491265 pagination = pagination ,
12501266 paginationPageSize = pagination_page_size ,
12511267 cacheBlockSize = cache_block_size ,
12521268 enableCellSpan = use_cell_span ,
1253- ** ( grid_options or {}) ,
1269+ ** normalized_grid_options ,
12541270 )
12551271
12561272 context = PyWryGridContext (
0 commit comments