How to use the datagrid field to filter the data
I have created a vb.net project with several forms and now I have a question. I want to filter the data stored in a datagridview
according to the months.
Consider the data as given below
CUSTOMERNAME MONEY DATE
RAJA 1000 5/22/2011
RAM 15872 12/28/2010
RESHMA 12542 10/15/2010
POONAM 12345 2/25/2011
SANDEEP 54543 5/15/2011
Consider a combobox with a list of months (1 2 3 ... 12) , when the user chooses a month, I wa开发者_运维问答nt to filter the data in the datagridview
according to the chosen month.
If the user selects 5 it must filter the result and show only
RAJA 1000 5/22/2011
SANDEEP 54543 5/15/2011
Since your question is fairly general here are a couple of links that will get you in the right general question. If you want more specific help you can Edit your question and include what you've tried so far.
Here's an article on the DataView.RowFilter Property
Here's a linq solution to sum a column on a dataset, it far from the only way you can do this.
精彩评论