Declare textbox within ur grid view like this
<itemtemplate>
<asp:textbox id="txtUID" runat="server" cssclass="TextBox" onkeypress="return isNumberKey(event);" xmlns:asp="#unknown" />
</itemtemplate>
and in head section of the page add script
<script type="text/javascript">
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
hope this helps u
enjoy :)