I would try making a dataview that listens to your datagrid and put you button in there. You can then apply a visibility criteria of $current_object != empty to hide the button. You may have to work a bit to get the layout to look like it did though.