Hello All,
I have two grids in my application.
In Grid One there is an Input field. The entered data from the input fields are bounded to the drop-down list in the Grid Two.
The data enter in the Input fields from the Grid One will be display in the drop-down list in the Grid Two. Refence mention in the below snap.
My question
The Input fields data(From Grid One) which are selected/bounded in the drop-down list ( In Grid Two) should not allowed to delete.
The only data should be allow to delete which are not selected/bounded in the drop-down list of the Grid Two.
For e.g.
The Input fields values “AAAA” and “BBBB” are Selected in the dropdown list. (They should not allow to deleted).
But Input fields values “DDDD” is not Selected in the dropdown list , so it should allow to delete. When clicked on the delete Red Icon button.
We are using Structures for data binding. I can't share OML files.
Can anyone Help me on that. If someone can provide OML that would be helpful.
Thanks in Advance.
JKs
Hi JK,
Do you want to only restrict the delete operation, or want to even hide the delete icon on the grid?
If you keep the delete icon on UI, the implementation is pretty straightforward. On click of delete item, loop through the items on Grid Two, and find if any of the items match with the value being deleted. System module provides a ListAny action, which can be used to optimally achieve this.
If you want to remove the delete button itself on the UI, you've to then do a bit more of implementation in the Grid Two's dropdown. Inside the OnChange event of the dropdown you need to find the selected dropdown item's record in the Grid One, and mark it unavailable for deletion. If this app is going to be used by production users, I would implement both options to foolproof the app in both ways. It depends on how much secure and user friendly you want to make it.
If you can provide a separate OML that doesn't breach into any of your sensitive data, would be great. I can easily fix it for you.
Hello Ravi,Thanks for you reply.
I have attached OML file from Personal Env. Demo. You can use that and implemented on it.
The Drop Down list also should be in another Grid. Which i have not implemented.
Note:- We are using Structure for data binding.
Thanks:)