DataConnector.Find

  • Thread starter Thread starter Jaga
  • Start date Start date
J

Jaga

Hello,

I have a DataConnector (.NET 2.0) bounded on a DataTable.
I'd like to set the current Item to the DataRow wich contains "XY" in the
column "Name". How can I do that?

I could use the method Find(PropertyDescriptor prop, object key), if I would
know, how to get the PropertyDescriptor for the column "Name".
But the DataConnector's GetItemProperties method is private.


Thanks,

Jaga
 
using System.ComponentModel;

....

public NavigateById(int id)
{
PropertyDescriptor propDescriptor =

TypeDescriptor.GetProperties(myDataSet.MyDataTable.NewMyDataTableRow())["MyColumnName"];

myDataConnector.Position = myDataConnector.Find(propDescriptor, id);
}

HTH,
Juan
 
Hi Juan,

Thank you, it helps.


I have now an other one too:

PropertyDescriptorCollection pdc =
CurrencyManager.GetListItemProperties(myDataConnector.DataSource);
myDataConnector.Position = myDataConnector.Find(pdc["MyColumnName"], id);


Jaga



Juan Ignacio Gelos said:
using System.ComponentModel;

...

public NavigateById(int id)
{
PropertyDescriptor propDescriptor =

TypeDescriptor.GetProperties(myDataSet.MyDataTable.NewMyDataTableRow())["MyC
olumnName"];

myDataConnector.Position = myDataConnector.Find(propDescriptor, id);
}

HTH,
Juan

Hello,

I have a DataConnector (.NET 2.0) bounded on a DataTable.
I'd like to set the current Item to the DataRow wich contains "XY" in the
column "Name". How can I do that?

I could use the method Find(PropertyDescriptor prop, object key), if I would
know, how to get the PropertyDescriptor for the column "Name".
But the DataConnector's GetItemProperties method is private.


Thanks,

Jaga
 
Back
Top