Try this
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
<asp:CustomValidator ID="CustomValidator2" runat="server"
ClientValidationFunction="gvPostDatedChequeValidation" ErrorMessage = "GridView has no rows."></asp:CustomValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
<script language="javascript" type="text/javascript">
function gvPostDatedChequeValidation(source, args) {
var grid = document.getElementById("<%=GridView1.ClientID%>");
args.IsValid = grid != null;
}
</script>
Now you can easily attached Validator callout to the Custom Validator and use it