Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to bind my List to datagridView
    primarykey
    data
    text
    <p>I was working on a project in which I was binding my custom list to a datagrid. I thought I might have some issues in my current application, so I decided to make a new sample application in 4.0 but same issue.</p> <pre><code>namespace WindowsFormsApplication1 { public partial class Form1 : Form` { public Form1() { InitializeComponent(); } private void populate() { List&lt;BillInfoCustom&gt; oSalesList = new List&lt;BillInfoCustom&gt;(); BillInfoCustom oSalesType = new BillInfoCustom() { BillId = 1, BillDate = DateTime.Now.ToLongDateString(), CashPayment = 10, CreditCardPaymet = 20, CustomerName = "asda", TotalPrice = 20.0 }; BillInfoCustom oSalesType2 = new BillInfoCustom() { BillId = 1, BillDate = DateTime.Now.ToLongDateString(), CashPayment = 10, CreditCardPaymet = 20, CustomerName = "asda", TotalPrice = 20.0 }; BillInfoCustom oSalesType3 = new BillInfoCustom() { BillId = 1, BillDate = DateTime.Now.ToLongDateString(), CashPayment = 10, CreditCardPaymet = 20, CustomerName = "asda", TotalPrice = 20.0 }; oSalesList.Add(oSalesType); oSalesList.Add(oSalesType2); oSalesList.Add(oSalesType3); dataGridView1.DataSource = oSalesList; } private void button1_Click(object sender, EventArgs e) { populate(); } } public class BillInfoCustom { public int BillId; public double TotalPrice; public double CashPayment; public double CreditCardPaymet; public string CustomerName; public string BillDate; } } </code></pre> <p>And here is the output after I press button:</p> <p><img src="https://i.stack.imgur.com/baf6I.png" alt="output"></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.
 

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