246
Views
8
Comments
Solved
[OutSystems Data Grid] Clear dropdown column on datagrid reactive
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

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

TestClearGridDropdown.oml
2020-08-05 09-00-16
Gabriel Lundgren
Solution

I think I understood now. Please check the attached OML to see if it's what you want.

TestClearGridDropdown.oml
2021-03-18 21-03-15
Benjith Sam
 
MVP

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

TestClearGridDropdown.oml
UserImage.jpg
Daniele Betti

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 

2020-08-05 09-00-16
Gabriel Lundgren

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?

UserImage.jpg
Daniele Betti

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.


TestClearGridDropdown.oml
2020-08-05 09-00-16
Gabriel Lundgren

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.

UserImage.jpg
Daniele Betti

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! 

2020-08-05 09-00-16
Gabriel Lundgren
Solution

I think I understood now. Please check the attached OML to see if it's what you want.

TestClearGridDropdown.oml
UserImage.jpg
Daniele Betti

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!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.