Hi -
I am getting the following error
Key not found Parameter name: key System.ArgumentException: Key not found Parameter name: key at Infragistics.Shared.
LastDownloadView.Items.Clear(); // this is the WinListView DataTable dt = GetDisplayTable(); int count = 0; foreach (DataRow row in dt.Rows) { String location = row["Location_Name"].ToString(); string downloaded = row["Number_Files_Downloaded"].ToString(); String key = count.ToString(); count++; Infragistics.Win.UltraWinListView.UltraListViewItem item = LastDownloadView.Items.Add(key, location); item.SubItems["LastDownloadTime"].Value = row["Time"].ToString(); item.SubItems["NumberFilesDownloaded"].Value = downloaded; }
}
I am not able to reproduce the error in dev. but I assume it is in the highlighted rows (since they are the ones doing the lookups by column names). However, both the columns LastDownloadTime and NumberFilesDownloaded are created at design time and hence are guaranteed to be present. Also, if one of the columns was not present, this error should come up on every run (but that's not the case).
Will appreciate any suggestions.
Sameer
I can't even begin to speculate about why this problem is intermittent, but the exception is thrown when you access a member the collection with a non-existent key. If you are able, attach a simple sample project and we will take a look and try to determine why the excception is thrown.