Note that there are some explanatory texts on larger screens.

plurals
  1. POc# DataGridView.DataSource = BindingList Doesn't Work
    primarykey
    data
    text
    <p>I create a binding list <code>BindingList&lt;RunData&gt;</code> and pass it through <code>CustomMessageBox.Show()</code> but the <code>DataGridView</code> doesn't display the list elements.</p> <pre><code>public partial class CustomMessageBox : Form { #region Fields. private static CustomMessageBox customMessageBox; private static String selectedDateTime; #endregion #region Properties. internal String SelectedDateTime { get { return CustomMessageBox.selectedDateTime; } } #endregion #region Constructors. private CustomMessageBox() { InitializeComponent(); } #endregion #region Methods. internal static DialogResult Show(BindingList&lt;RunData&gt; dataGridViewData) { CustomMessageBox.customMessageBox = new CustomMessageBox(); CustomMessageBox.customMessageBox.dataGridViewRunData.AutoGenerateColumns = true; CustomMessageBox.customMessageBox.dataGridViewRunData.DataSource = dataGridViewData; return CustomMessageBox.customMessageBox.ShowDialog(); } #endregion } internal class RunData { #region Fields. private String dateTime; private String name; private String product; private String result; #endregion #region Properties. internal String DateTime { get { return this.dateTime; } } internal String Name { get { return this.name; } } internal String Product { get { return this.product; } } internal String Result { get { return this.result; } } #endregion #region Constructors. internal RunData(String dateTime, String name, String product, String result) { this.dateTime = dateTime; this.name = name; this.product = product; this.result = result; } #endregion } </code></pre> <p>I have never used <code>BindingList</code> before but from the examples I found online it looks like I did everything OK. Any help would be appreciated.</p> <p>Thanks!</p> <p><strong>EDIT</strong></p> <p>I'm using .NET 2.0 if that makes any difference.</p>
    singulars
    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.
 

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