Hi, I have a class
public class ANote{
public string NoteId = "";
public string Note = "";
public string NoteCollector = "";
public DateTime NoteCollectionDate = DateTime.MinValue;
public string NoteCollectionDay {
get { return NoteCollectionDate.toString("MM/dd/yyyy") ; }
}
public string NoteCollectionTime {
get { return return NoteCollectionDate.toString("hh/mm tt"); }
}
public DateTime ADate = DateTime.Now;
public double AAmount = 0.0D;
public string AName = "";
}
And a BindingList aList;
Also have a grid with a bunch of DataGridTExtBoxColumns that I try to bind to the above (already populated) List like :
colDate.DataPropertyName ="NoteCollectionDay";
colTime.DataPropertyName = "NoteCollectionTime";
colName.DataPropertyName = "NoteCollector";
colADate.DataPropertyName = "ADate";
colAAmount.DataPropertyName = "AAmount";
colAName.DataPropertyName = "AName";
colNotes.DataPropertyName = "Note";
grdNotes.AutoGenerateColumns = false;
grdNotes.DataSource = aList;
But at runtime, only my colDate and colTime columns populate properly. All others are blank.. When I look specifically at the Grid.Rows[idx].Cells[idx].Value for the other colmns it's all null.
Also if I set AutoGenerateColumns to true, I see an additional column NoteID and that is also filled properly, but the ANote, Amount, ADate, AName and Note fields are still blank !
There is nothing wrong with the data in the list .. all the class members have valid values.
Unless I'm missing something It seems to be an issue with BindingList or DataGridView .. If not, any ideas on how to debug this..it's a pretty simple testcase !