hide and show grid programmatically correctly.