Datagrid CurrentRowIndex returns -1??
Posted
by runxc1 Bret Ferrier
on Stack Overflow
See other posts from Stack Overflow
or by runxc1 Bret Ferrier
Published on 2009-05-20T16:15:10Z
Indexed on
2010/06/10
22:02 UTC
Read the original article
Hit count: 235
This seems quite odd. I have a Datagrid (.net 3.5 cf) that I bind to either a List or Inventory[]. When I click on a row and then hit a button to perform an action when I bind to a List CurrentRowIndex is -1. When I bind to Inventory[] and perform the same action CurrentRowIndex comes back with the selected row why is that??
grdBatch.DataSource = InventoryItems.ToArray();
vs
grdBatch.DataSource = InventoryItems;
© Stack Overflow or respective owner