Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(GridView.Rows.Count == 0)
- {
- // Do Something
- }
- DataTable data = DAL.getdata();
- if (data.Rows.Count == 0)
- {
- ShowEmptyData();
- }
- else
- {
- Grid.DataSource = dt;
- Grid.DataBind();
- }
- <asp:GridView runat="server">
- <EmptyDataTemplate>The grid is empty</EmptyDataTemplate>
- </asp:GridView>
- int rowCount = GridView.Rows.Count; // returns zero
- GridView.DataBind();
- rowCount = GridView.Rows.Count; // returns actual row count
Add Comment
Please, Sign In to add comment