Hi,
I need to clear the dropdown cell in a datagrid reactive object. I tried using setCellData but I still see the old selection.
Which is the correct way to clear the content of a dropdown cell?
I attach an example oml where I tried to clear the second column after editing the first.
Thank you
I think I understood now. Please check the attached OML to see if it's what you want.
Hi Daniele,
It worked for me when I set the CellData value to NullIdentifier() as shown below. Can you try the same?
See this demo screen: DataGrid_ClearColDropdown
Refer to the updated attached oml.
I hope this helps you!
Kind regards,
Benjith Sam
Thank you, but I've already tried your solution without luck.
I tested your oml and it have the same issue.
The demo screen you sent has a different scenario and I think it uses parent binding.
BR, Daniele Betti
Hello @Daniele Betti,
Sorry for the delay. I believe what you are looking for can be found on this forum post. Can you please take a look and let me know if it works?
Unfortunatly seems not.
You can find attached an oml where I tried the given solution.
The goal is to clear the selection of the dropdown column (Role) as the user edit the first column.
You've tried the following snippet?
GridAPI.GridManager.GetGridById($parameters.GridWidgetId).getColumn($parameters.ColumnWidgetId).provider.isRequired = false;
Where you put the grid Id and the column's Id. After that, to clear the values, press delete/backspace.
Of course I tried the snippet... but in anycase I think I've not explained really well the scenario.
I don't need to clear the dropdown when the user hit delete/backspace.
I need to clear programmatically the column as another column is changed by the user.
It is like what happen when we use parent binding between two dropdown: the child column is cleared when the user change the value of the parent column.
Unfortunatly my case is not related to parent binding, I need to clear the dropdown only if the value chosen by the user in a different column is equal to a defined value.
Please see the oml I've attached.
Thank you for your support!
Great it works! I swear I tried with setting the value to "" but without success. The clue was to use both the snippet you mentioned and setting the value to "".
Many thx!