Help with rows in a datagrid
I have a problem. 开发者_开发百科I have an app that allows you to right click on a row in the datagrid and a menu item pops up that lets you copy, move, or delete the row. When i click on one of these options, I get a nullReferenceException. When i step through, I am getting a null value on qv.Name. Anyone got any ideas? Also, let me know if you need more code. Thanks.
From your code, I think you want:
QuarantineViewDS.QuarantineViewRow qv =
dgSystemView.SelectedItem as QuarantineViewDS.QuarantineViewRow;
instead of:
QuarantineView qv = dgSystemView.SelectedItem as QuarantineView;
精彩评论