DataGridViewCellStyleFormmating

Jan 11 2012 3:46 PM
Hi everybody,

I'm working with Csharp .Net 2.0,  I have a grid view that I need to customize format for each cell for many field depending on the currency:

code
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
        if (e.ColumnIndex == 2 & e.RowIndex<3)
        {
                e.CellStyle.FormatProvider = CultureInfo.CreateSpecificCulture(dataGridView1[1, e.RowIndex].Value.ToString());
                e.CellStyle.Format = "C";
        }
}

But modification is not being commited due to the error occuring when editing on all cells that have different culture than the default set in regional settings.

What to do???

Answers (1)