DGV - AddSummaryRow - Conditional Calculation

Closed
0
0

Hi.

I have some situations where I need to calculate the summary row due conditionals of some settings.

ex: Sum only products, grouped by Product Category,  in stock, with value > x , but displaying all items …

colValue (in bold type) >= 10000′ should be the conditional filter …

The command should be some thing like this:

subProducts = grid.AddSummaryRows(SummaryType.Sum, SummaryRowPosition.Parent, colGroup, colGroup, colVValue, colValue >=10000 ‘, DGVstyles.MonthStyle);

In the grid,  I add one column where I fill it with values that should be filterd (or use some existing column).

The question is … Is there a way to sum with dgv.AddSummaryRow , filtering based on one conditional ?

Hope it´s clear …

Regards

  • You must to post comments
0
0

Thanks Kevin …

It´ll be usefull for all …

Best regards

  • You must to post comments
0
0

I send you one

  • You must to post comments
0
0

Hi Kevin,

I alread had try to use it … but I didn´t find how to set the condition  … and didn´t find the  DataGridView.CustomSummary in Docs too …

If not asking too much, could you please write here an example of how to use it  ?

Thanks

 

 

  • You must to post comments
0
0

Hi MARCELO,

You can use SummaryType.Custom for create a custom condition for your Summary.

And set parameter “customSummary” ,with new delegate of DataGridView.CustomSummary.

This delegate will  help you to check your Data.

Docs:

Happy coding,

Kevin (ITG)

  • You must to post comments
Showing 4 results