I have the data below, and I used RowFilter
to filter the ID, and only show rows that have ID = 111
. However, I need to create a "Next" button to be able to go to the next unique ID which is 222. The IDs are not incremental.
Any tips on how to approach this? I am running out of options
string[] columnnames = file.ReadLine().Split('|');
DataTable dt = new DataTable();
foreach (string c in columnnames)
{
dt.Columns.Add(c);
}
string newline;
while ((newline = file.ReadLine()) != null)
{
DataRow dr = dt.NewRow();
string[] values = newline.Split('|');
for (int i = 0; i < values.Length; i++)
{
dr[i] = values[i];
}
dt.Rows.Add(dr);
}
DataView dv = new DataView(dt);
dv.RowFilter = "ID = '111'";
dataGridView1.DataSource = dv;
I used dv.RowFilter = "ID = '111'";
however how can I make it dynamic so it can go to the next ID= 222
?
Thanks