Try using DataGridViewRow's DataBoundItem property this should be your "customObject"
DataGridViewSelectedRowCollection contains DataGridViewRow objects thus cannot have your customObject directly. E.g. int var = ((customObject) DataGridView1.SelectedRows(0).DataBoundItem).MyProperty; On Tue, Aug 31, 2010 at 11:43 PM, Dewang Lakhani <[email protected]>wrote: > Hi, > > This is my first post and i am new to c#. I have a > bindinglist<customObject> obj. I am able to show it on the > datagridview by doing :- dataGridView.datasource = obj. > > How can i fetch the selected rows in the datagridview directly as > (customObject) or list of them. I am getting a > DataGridViewSelectedRowCollection which I cannot type cast to > bindinglist<customObject>. Please help. Thanks > > > regards, > Dewang
