I have a Window in which I bind my DataGrid source to a DataTable with a tree-like structure. In the window, I have a TextBox, and two buttons ("Contains", and "Exact"). And the following is a sample data (in text), along with the Table image:
Comedy
English
21 Jump Street
C Tatum
J Hill
22 Jump Street
C Tatum
J Hill
Dumb and Dumber
J Carrey
J Daniels
Action
English
Mission Impossible 5
T Cruise
J Renner
Hindi
Singham
A Devgn
K Agarwal
http://oi58.tinypic.com/301mtko.jpg
I have a few things I would like to do:
Using the text entered and depending on the button clicked, I'd like to filter my last column (lead actor) of my GridView (just update grid view, not saving to the DataTable). So for example, typing "tum" and clicking 'exact' would do a similar search as it is done for DataTable using DataView, in this case, returning nothing. When 'contains' button is clicked, it should return (GridView table):
Comedy
English
21 Jump Street
C Tatum
22 Jump Street
C Tatum
And a 'contains' search for "ar" should return (on the GridView table):
Action
Hindi
Singham
K Agarwal
I have read here and there that I should use BindingSource (https://stackoverflow.com/a/21845837/5003918), but I am not sure exactly how to use it (and return the hierarchy instead of just matching rows). My actual data will probably have unique last columns (unless contains search is used).
Lastly, I have an "export" button which I would like to use to export the current GridView into a CSV.
- To summarize what I need help with:
- "Contains" search from GridView
- "Exact" search from GridView (BindingSource?)
- Export GridView data (Exporting datagridview to csv file ; Getting an error atm)
I hope, I have (accurately) provided enough information to obtain help. :)