I have added row.HasOID == true to the while condition but still get the popup. I have tried an If statement surround everything below selectionSet.Search(null, false, out cursor); as well and that didnt work either. Am I placing it in the wrong spot?
try
{
IFeatureSelection featureSelection = (IFeatureSelection)featureLayer;
ISelectionSet selectionSet = featureSelection.SelectionSet;
ICursor cursor;
selectionSet.Search(null, false, out cursor);
IRow row = cursor.NextRow();
comboBox1.Items.Add(row.OID.ToString());
textBox2.Text = row.OID.ToString();
while (cursor != null && row.HasOID == true)
{
System.Diagnostics.Debug.WriteLine(row.OID.ToString());
row = cursor.NextRow();
comboBox1.Items.Add(row.OID.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}