I manage to find a solution using this method
private void Gridview_Output_CellEndEdit_1(object sender, DataGridViewCellEventArgs e)
{
try
{
pre lang="cs">int RowIndex = e.RowIndex;
int columnIndex = e.ColumnIndex;
if (e.ColumnIndex == 2)
{
bool validation = true;
if (Gridview_Output.Rows[RowIndex].Cells[columnIndex].Value != null && Gridview_Output.Rows[RowIndex].Cells[columnIndex].Value.ToString().Trim() != "")
{
string DataToValidate = Gridview_Output.Rows[RowIndex].Cells[columnIndex].Value.ToString();
foreach (char c in DataToValidate)
{
if (!char.IsDigit(c))
{
validation = false;
break;
}
}
if (validation == false)
{
MessageBox.Show("Font must be numbers only", "Error Message", MessageBoxButtons.OKCancel,MessageBoxIcon.Warning);
Gridview_Output.Rows[RowIndex].Cells[columnIndex].Value = "";</pre>