We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Customers-Products

Hi,

  I need in a gridgrouping control show the customers and the products for all orders in the BD, not the orders, only the products.
  I have relationed customer-orders-products, mi idea 

PassThroughGroupingResult ListadoFacturas = new PassThroughGroupingResult(
                    "Clientes",
                    clientes,
                    typeof(Cliente),
                    totalclientes,
                    clienteejem,
                    new UpdateHelper()
                    );

            PassThroughGroupingResult orderResults = new PassThroughGroupingResult(
                    "ArticuloFacturaCliente",
                    new NestedQueryResultsDelegate(this.GetOrdersForCustomer),
                    typeof(Prueba),
                    artiejem
                    );


            Record r = grid.Table.CurrentRecord;
            object o = r.GetValue(this.grid.TableDescriptor.Fields[0]);

            var orderQuery =
                from p in datos.ArticuloFacturaCliente
                join f in datos.FacturaCliente
                on p.NumFacturaCliente equals f.Id
                where f.Cliente.Equals(o)   -- > or key[0]
                select p
                ;

            totals = orderQuery.Count();
            return orderQuery;

It´s posible, thanks.
PD:My English it´s not good as i like


10 Replies

AK Adhikesevan Kothandaraman Syncfusion Team June 3, 2016 02:18 PM UTC

Hi Ruben, 

Thanks for using Syncfusion products. 

We have analyzed your query at our end. We need some more information about reported scenario. Can you please attach an image of your requirement, it will be more helpful to find the solution at the earliest. 

Regards, 
Adhi 



RU Ruben June 6, 2016 03:40 PM UTC

HI Adhi, thanks for your reply

I have a database with customers, for each customer have a lot of orders with products , my idea is in a gridgrouping control show all customers, when clicked on one show all products he  bought in all orders grouped by reference. Not show the orders only the products.

The relations in database are customers-orders-products, not are relation between the table of customers and products.

I hope I explained better, it´s posible?




AK Adhikesevan Kothandaraman Syncfusion Team June 7, 2016 03:16 PM UTC

Hi Ruben, 

Thanks for your update. 

If you want to hide the child table details from the grid, you can remove that relation from the parent table. Please refer to the following code snippet, 
Code Snippet: 
//To hide the details of the child table  
this.groupingGrid1.Table.RelatedTables.RemoveAt(0); 
 
Please let us know whether you want to hide which portion of records from the following screenshot, it would be more helpful to find the solution at the earliest, 
 
 
 
 
 
Regards, 
Adhi 



RU Ruben June 7, 2016 06:44 PM UTC

Hi Adhi, thanks

I show you an example, i have a customer with number xyz, he have two orders in first order have a product xxx with 30 of quantity, in the second 10 of quantiy of the same product. Mi idea it´s not hide the order line and show the products, i need two group the products in a single row.
Customer XYZ
Product xxx quantity 40--> the sum of quantity from any order in a specific time.
Parent Record --> The Customers.
Child Recors --> The sum for profucts in any order.
In your example it´s the category -> product -> order. But i need customer -- Sum(products)
It´s for show the customer buy grouped for product, the order it´s insignificant
Thanks





RU Ruben June 8, 2016 11:53 AM UTC


Continuing with this example, in the image the customer ALFKI have two orders with product id 28





AK Adhikesevan Kothandaraman Syncfusion Team June 8, 2016 02:12 PM UTC

Hi Ruben, 

Thanks for your update. 

We have analyzed your reported scenario at our end. Unfortunately the image that you had provided is not properly attached. So we cannot exactly understand what you are trying to do. In the below update, we have provided the solution based on what we have understood from our end.  
The reported scenario can be achieved by grouping the Product table with the ProductName, it will automatically group the same products with in a single group and displays the count of the items in the group caption as shown  in the following screen shot,  

 

The Caption Summary can be used to display the sum of the Quantity of the grouped items in the group caption. Please refer to the following UG document, 

UG Location: 
 
Note 
If we misunderstood your query, please provide the screenshot in Zip folder instead of providing in the incident directly to avoid the miscommunication. It would be better for us to provide prompt solution earlier. 
 
Regards, 
Adhi 



RU Ruben June 8, 2016 05:56 PM UTC

Thanks for the reply, 

  The image it´s a example project from syncfusion help, the order 10643 have a product id 28 and the 10952 have the same product. I need "hide" the orders and show the products grouped by reference in diferent orders, with the sum of quantiy.

Result for the example

Parent Record--> 
  Customer ID    Company Name
    ALFKI                   Alfreds
Child Record--> 
ProductId     Quantity
   28                    17
   6                      16
   46                     2

Thanks 


Attachment: sg_39862a3d.rar


AK Adhikesevan Kothandaraman Syncfusion Team June 9, 2016 06:13 PM UTC

Hi Ruben, 

Thanks for your update. 

We have analyzed your reported scenario at our end. By default, the grid will display the data as per the design of the data source. Therefore, the reported scenario is not possible. If you want to display the details as per your results, you need to design the data source with computing the necessary fields and assign it to the GridGroupingControl. 

Regards, 
Adhi  



RU Ruben June 10, 2016 07:31 AM UTC

Ok thanks for the help.


AK Adhikesevan Kothandaraman Syncfusion Team June 13, 2016 03:54 AM UTC

Hi Ruben, 
 
Thanks for your update. 
 
Please let us know, if you have any other concern. 
 
Regards, 
Adhi 


Loader.
Live Chat Icon For mobile
Up arrow icon