Exemplo n.º 1
0
        private void btnProductName_Click(object sender, EventArgs e)
        {
            Product product = Linq2Objects.GetProduct(txtProductId.Text);
            //Need to bind to grid
            //Hence creating a temporary list for binding purposes
            List <Product> pList = new List <Product>();

            pList.Add(product);
            dataGridView1.DataSource = pList;
        }
Exemplo n.º 2
0
 private void btnGroupBy_Click(object sender, EventArgs e)
 {
     foreach (var group in Linq2Objects.GroupBy())
     {
         //Console.WriteLine(group.Key == 0 ? "\nEven numbers:" : "\nOdd numbers:");
         foreach (int i in group)
         {
             lstGroupBy.Items.Add(i);
         }
     }
 }
Exemplo n.º 3
0
 private void btnOrderBy_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = Linq2Objects.OrderByProducts();
 }
Exemplo n.º 4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //dataGridView1.DataSource = Linq2Objects.GroupProductsByCategory();
     dataGridView1.DataSource = Linq2Objects.Joins().ToList();
 }