DataGridview - Avoid Row UnSharing

  • Thread starter Thread starter Ashutosh
  • Start date Start date
A

Ashutosh

Hi,
I read this article about datagrid view.
http://msdn.microsoft.com/en-us/library/ha5xt0d9.aspx

I haver over 50,000 items in my dataGridView (which is bound to a data
table) and I want to avoid row unsharing. But I need to handle some data grid
events like "CellMouseClick" and want to do some processing.

But the issue is that for all the events, I get only the row and column
Index. If I access the row or cell using the indexes, the row becomes
un-shared. Something like this "dgvContactList.Rows[e.RowIndex]"

So, how do I retrieve the underlying row (Not interested in the column/cell)
either DataGridViewRow or DataRow (I understand that DataRow can be retrieved
from DataGriedViewRow :) )?

Thanks & Regards,
Ashutosh
 
Even retrieving the row using the SharedRow method, something like this

DataGridViewRow r = dataGridView1.Rows.SharedRow(e.RowIndex);

doesn't help as using this row object, I can't get the value in the
cell/rows nor the underlying data row object.


Regards,
Ashutosh
 
Back
Top