1
Answer

Find window handle in WPF, C#

Ramana

Ramana

13y
4k
1
Hi,
   Can any one tel me how to find the window handles in WPF , C#.
   I've opened two excel's in my Wpf Window form, now I have to get the handle to those two excel files so that I can read the excel files content.

Thanks & Regards,
Ramana
Answers (1)
1
Naresh Singhal

Naresh Singhal

NA 567 850 7y
Hi , going through your problem, i think you need to use Linq join to retireve data from muliple
 
tables, to use join its very simple  :) 
0
First Last

First Last

NA 35 469 7y
Actually, I resolved this (with help from a great guy) and here is the working action method:
 
It creates a header/multi detail view (not a flattend view which i was intially trying to get).
 
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage 
 
public ActionResult GetCustomerOrdersDetails()
{
// Calls the method to populate the list.
List customerOrders = null;
using (DashboardContext _context = new DashboardContext())
{
customerOrders = _context.OrderSet
.GroupBy(x => new { Name = x.Customer.CustomerName, Image = x.Customer.CustomerImage, Date = x.OrderDate })
.Select(x => new CustomerOrdersViewModel
{
CustomerName = x.Key.Name,
CustomerImage = x.Key.Image,
OrderDate = x.Key.Date,
OrderDetailsViewModel = x.SelectMany(y => y.OrderDetail).Select(y => new OrderDetailsViewModel
{
Quantity = y.Quatity,
ProductType = y.Product.ProductType,
ProductName = y.Product.ProductName,
ProductImage = y.Product.ProductImage
}).ToList()
}).ToList();
}
// Return a partial view.
return PartialView("~/Views/Dashboard/GetCustomerOrdersDetails.cshtml", customerOrders);
}
 
Next Recommended Forum