Abnormal behavior of a added checkbox control of a grid


This is the first time I'm posting a question on this forum. I am new to Dynamics 365 and X++ programming language. Please forgive me if I am not been specific or not using the correct terminology. 

Here is my problem: 

I've created an extension for WHSLoadPlanningWorkbench form as WHSLoadPlanningWorkbench.ExtensionXXX. 

In this form, under the LoadGrid (Grid), I've added a checkbox control field. The primary key of the LoadGrid is LoadId. 

I've also added an a menu item button (called Lock Load), under the ActionPaneTabLoad (Action Pane Tab)/ Actions (Menu Button). 

As per my technical design document this is what needs to happen: 

There will be more than one record in the LoadGrid. And the user will have to select a record and click on the Lock Load button. 

Clicking the Lock load menu item button should create a new record in a table (LockingHistory) that I've created. Once that is done LoadGrid should be refreshed with all the records and the checkbox should be populated based on the records in the LockingHistory. 

Currently this is what is happening... 

I've placed some code under OnClicked Event of the Lock Load action menu item button. So when a user selects a record and click Lock Load button, that would trigger the inserting a new record in to the new table. However after that LoadGrid refresh doesn't happen properly. 

Let's say I have 5 records in the LoadGrid and I pick one. Then I click on the Lock Load button. That would refresh the LoadGrid and only the picked record  will be shown. Rest of the records (4) will not be be shown. 


What am I missing? Can someone guide to the right direction please?