I am new to datagridview. I have datagrid cellformatting event. when this event is fired e.Value is coming as null. if i bind the datasource with Bindinglist then e.Value is Null if i bind the directly with the IList, i am getting proper value.
private void Form1_Load(object sender, EventArgs e)
{
IList<MyClass> myClassList = new List<MyClass>();
myClassList.Add(new MyClass());
myClassList.Add(new MyClass());
BindingList<MyClass> myClassDS = new BindingList<MyClass>(myClassList);
var source = new BindingSource(myClassDS, null);
dataGridView1.DataSource = source; //e.Value is null here
//dataGridView.DataSource = myClassList; //This is working fine
}
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
//e.Value is null. here i should get current cell value.
}