I believe you want the entire panel to be hidden when the data is empty. For this, set the
if (data.Rows.Count == 0) scrollableGridArea.Visible = false;
As for scrolling, if you want to keep the headers locked and data getting scrolled, you can place headers in separate table above the grid and have the grid's own ShowHeader=false. Then wrap the grid in a
<div style="height:200px; overflow: scroll">
<asp:gridview ...="" xmlns:asp="#unknown">grid properties
</asp:gridview></div>