How to solve Add Float value validation under DATAGRID – Windows Application C#?

Add Float value validation under DATAGRID – Windows Application C#.

Solve Add Float value validation under DATAGRID – Windows Application C#.

Below solution.

Hear I write solution for your problem Please use it.
I think it is helpful for you….Happy Coder


private void txtPurchasePrice_KeyPress(object sender, KeyPressEventArgs e)
{
Validate(e);
}

private void Validate(KeyPressEventArgs E)
{
if (!char.IsNumber(E.KeyChar) & (Keys)E.KeyChar != Keys.Back
& E.KeyChar != '.')
{
E.Handled = true;
}
}

Solution of Add Float value validation under DATAGRID – Windows Application C#.

About the Author

avatar