Searching for items

Sep 16, 2008 at 10:09 AM
-Is there a quick way to locate a listview row given the values of several columns instead of only one?
-Is there a way to locate a window by its name instead of just the caption or index?
Coordinator
Sep 17, 2008 at 2:36 AM
1. listView.Rows.Find(delegate(ListViewRow row) { return row.Cells["column1"].Equals("foo") && row.Cells["column2"].Equals("bar"); });
2. Use this Application.GetWindow(SearchCriteria searchCriteria, InitializeOption initializeOption) to find based on what you are interested in.
Sep 17, 2008 at 10:49 AM
Thanks! this is what I was looking for:

listView.Rows.Find(delegate(ListViewRow row) { return row.Cells["column1"].Equals("foo") && row.Cells["column2"].Equals("bar"); });

But then I'm trying to create a function where the number of columns to check is unknown so how can I make it to allow to check any given number of columns?