Note that there are some explanatory texts on larger screens.

plurals
  1. POsome of my class<T>'s members don't turn up on datagridview bound to BindingList<T>
    primarykey
    data
    text
    <pre><code>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 = ""; } </code></pre> <p>And a BindingList aList;</p> <p>Also have a grid with a bunch of DataGridTExtBoxColumns that I try to bind to the above (already populated) List like :</p> <pre><code>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; </code></pre> <p>But at runtime, only my colDate and colTime columns populate properly. All others are blank.. When I look specifically at the <code>Grid.Rows[idx].Cells[idx].Value</code> for the other colmns it's all null. </p> <p>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 !</p> <p>There is nothing wrong with the data in the list .. all the class members have valid values. </p> <p>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 !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload