Answer the question
In order to leave comments, you need to log in
How to implement filtering in DataGridView?
Hello. I have a program with the following form:
The gray area is dataGridView1 . The program creates/opens/modifies a text file and adds/deletes lines accordingly.
This is how the data is stored in a text file: You
need to implement the following functionality:
4.1. For a user-specified month, determine which route had the most buses.
4.2. For a user-specified month, display revenue data for each route in ascending order.
4.3. For a month specified by the user, display the number of exits per line for each driver.
4.4. For the specified route, build graphs of changes in the number of exits to the line by day during the specified month.
4.5. For a user-specified month, build a pie chart showing the number of buses on each route.
4.6. Build a bar graph of the distribution of income for the year by route.
foreach
to go through all the lines and for each cell with an index somehow look at the value of the fourth and fifth characters in the line (because there are 2 digits showing the month), then translate this into , compare with the value (month) , which the user entered in the corresponding one and after all this ... what? Output the received rows to a new grid? Turn off the visibility of other rows?
That is, to begin with, I need to somehow select the lines with the month of interest to me, then do something with them (find the most popular route / display income data).
Then I need to somehow display for each driver the number of exits (ie the number of mentions of the driver in the table) per line per month.[
]Int32
TextBox
Answer the question
In order to leave comments, you need to log in
You immediately load the data directly into the table from the file?
I would create an entity class that describes your data, then serealize the data from the file into a list, make a selection through linq, and bind the filtered list through the DataSource grid.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question