Also here can be used search abilities of an ArrayList container that presented by List property of DataRowCollection(IndexOf, BinarySearch..). DataRowCollection is returned by DataTable->Rows property. To access protected member without compiler's modifications lets doing something like this:
#pragma warning( disable : 4669)
public __gc class ListPropertyPublicRowCollection: public System:
ata:
ataRowCollection
{
public: inline static GetRowIndex(DataRowCollection* rc, DataRow* dr)
{ return reinterpret_cast<ListPropertyPublicRowCollection*>(rc)->List->IndexOf(dr);}
};
or like this
public __gc class ListPropertyPublicRowCollection: public System:
ata:
ataRowCollection
{
public: __property virtual ArrayList* get_List(){return DataRowCollection::get_List();}
};
...
reinterpret_cast<ListPropertyPublicRowCollection*>(myDataTable->Rows)->List->IndexOf(myDataRow);
choose that you like.