I created the little helper function below to confirm that a SL4 datagrid loads. Im getting inconsistent results attempting to run this function on the same grid. Basically sometimes it works sometimes not. Is there issues in the framework around this? Also if i actual break in vs2010 after the 'g' variable is set, and then try to put "?g" into the immediate window IE8 bombs.
Any thoughts?
public static void VerifyGridLoaded(SilverlightApp app, string gridName)
{
DataGrid g = app.FindName<DataGrid>(gridName);
g.Refresh();
Assert.IsTrue(g.Rows.Count() > 0, gridName + " is empty.");
}