Sort data using DataView
- by Kristina Fiedalan
I have a DataGridView with column Remarks (Passed, Failed). For example, I want to show all the records Failed in the column Remarks using DataView, how do I do that? Thank you. Here's the code I'm working on:
ds.Tables["Grades"].PrimaryKey = new DataColumn[] { ds.Tables["Grades"].Columns["StudentID"] };
DataRow dRow = ds.Tables["Students"].Rows.Find(txtSearch.Text);
DataView dataView = new DataView(dt);
dataView.RowFilter = "Remarks = " + txtSearch.Text;
dgvReport.DataSource = dataView;