Thank you Ashish,
I have found the problem it was because I was passing an invalid attribute name to the Id of the grid layout, so that when I was selecting a record in the grid, crm tries to read the id of that record which must be the primary attribute id of that entity,
and in that way it will be null so the number of selected records will always be 0 and the "Add" button is disabled.
Thank you again :).
Zarour