I have a List<string> and some saved values taken from a gridview. What I need is to use a few if statements in order to check if one of these values in the list are empty.
A simple for loop going through all the rows in the gridview and taking values from the right column:
for (int i = 0; i < GridView2.Rows.Count; i++)
{
string tasks = GridView2.Rows[i].Cells[3].Text;
datesList.Add(tasks);
}
Here is a very simple example of code I’m using to check if 2 is in the list:
if (datesList.Contains("2"))
{
Label1.Text = "It contains it";
}
else
{
Label1.Text = "No matches";
}
So does the list saves all values from the gridview no matter that some are empty?
Correct me if I’m wrong somewhere but it’s really confusing now…
To collect the set/filled fields: