Question DataGridView Matrix

windoz

Member
Joined
Apr 7, 2022
Messages
6
Programming Experience
1-3
Hi,

I have a .csv file which automatically updates with sales data. This data is loaded into a datagridview, but is there a way to display this into a datagridview matrix ?

Data is as follows;
Header as:
Person, Sales, Area

Data as:
Person 1, £200, North
Person 2, £100, South
Person 3, £95, North
Person 4, £500, West
Person 5, £400, North
Person 1, £200, East
Person 1, £500, North
and so on...we have 8 sales people but they will often visit other areas. The list is over 100 transactions.

Is it possible to achieve the following;

Have the data showing as a datagrid similar to a matrices, i.e.

NorthSouthEastWest
Person 12010
Person 20100
Person 30001
Person 40001
Person 51000


The data already sits in a datagridview, but I would want to count how many times their sales have appeared and counts these.

Also would it be possible for the North, South, East and West to load from the datagridview, rather than me fixing these.

Many thanks for any advice given.
 
There's no such thing as a "DataGridView matrix". A DataGridView is a DataGridView. It simply displays the data you provide it. If you want yours to display different data than what it does at the moment, you need to provide it different data. You simply need to create an appropriate data structure to store the data you want to display, then loop over the data you already have and tally the appropriate counts. You do it in pretty much exactly the same way as you would if you were doing it manually.
 
Back
Top