Using cellendedit method is recommended. As an alternatively, you can handle cellformatting event. Check whether the cell value is bigger than 1, if so, multiplyby 0.01. There are many things need to be considered. The following code is not completed but can give a hint. You need to add more logic to get and set the value.
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0)
{
if (e.Value != null && e.Value.ToString()!=""&& double.Parse(e.Value.ToString()) > 1 )
{
e.Value = double.Parse(e.Value.ToString()) * 0.01;
}
e.CellStyle.Format = "p";
}
}
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.