I'm experiencing weird behavior when trying to remove a row using v2023.3.1114. I created a test form in my main app and launch it like this:
Form1 form = new();
form.ShowDialog();
The form populates a grid by setting the DataSource to a collection of POCOs.
The grid has a a hyperlink column. When the user clicks the column, the goal is to have the clicked row disappear. I'm implementing it like this:
private void gvTaskNotifyType_HyperlinkOpening(object sender, HyperlinkOpeningEventArgs e)
try
{
int rowIndex = e.Row.Index;
gvTaskNotifyType.Rows.RemoveAt(rowIndex);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Problem is when the RemoveAt() method is called it throws a Object reference not set to an instance of an object . It may happen the first time or more often the 3rd. It also happens if I use Remove() and pass in a reference to the row object and also if I try to set the IsVisible property to false. The really strange part is that the error doesn't enter the catch handler. Rather, its stops on the form.ShowDialog(); line and breaks there.
Any ideas?
Carl