I\'m looking for a way to format DataGridViewTextBoxColumn so that the value to be databinded is formatted during databinding. For example I have a CompanyName property and
I don't know about the IFormatProvider, but can the DataGridViews CellFormatting-event help you?
private void dataGridView1_CellFormatting(object sender,
DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0)
{
e.Value = e.Value.ToString().Substring(0, 5); // apply formating here
e.FormattingApplied = true;
}
}
http://msdn.microsoft.com/en-us/library/z1cc356h.aspx?ppud=4