Guest User

Untitled

a guest
Jun 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. if(GridView.Rows.Count == 0)
  2. {
  3. // Do Something
  4. }
  5.  
  6. DataTable data = DAL.getdata();
  7. if (data.Rows.Count == 0)
  8. {
  9. ShowEmptyData();
  10. }
  11. else
  12. {
  13. Grid.DataSource = dt;
  14. Grid.DataBind();
  15. }
  16.  
  17. <asp:GridView runat="server">
  18. <EmptyDataTemplate>The grid is empty</EmptyDataTemplate>
  19. </asp:GridView>
  20.  
  21. int rowCount = GridView.Rows.Count; // returns zero
  22.  
  23. GridView.DataBind();
  24.  
  25. rowCount = GridView.Rows.Count; // returns actual row count
Add Comment
Please, Sign In to add comment