G
Guest
Hi,
I need to use the find method of a Dataview from a form being used as a
dialog box, to set the position of a Binding object on another form. I think
this is a pretty standard thing.
How do I reference the Binding Context object though as it is on another form?
This is what I’m doing:
// I get a compile error here – object reference required for non static
field
// I understand why this is happening, but how can I get around it?
DataView viewCategories = dsWindowControlMaster.Categories.DefaultView;
// Retrieve the search criteria from the textbox
int id = this.CategoryID;
// Use it with the view to find the index
int idx = viewCategories.Find(id);
// Use the index to set the Binding objects position
// This also cannot be referenced from here
BindingContext[dsWindowControlMaster, "Categories"].Position = idx;
Thanks for any ideas in advance.
Ant
I need to use the find method of a Dataview from a form being used as a
dialog box, to set the position of a Binding object on another form. I think
this is a pretty standard thing.
How do I reference the Binding Context object though as it is on another form?
This is what I’m doing:
// I get a compile error here – object reference required for non static
field
// I understand why this is happening, but how can I get around it?
DataView viewCategories = dsWindowControlMaster.Categories.DefaultView;
// Retrieve the search criteria from the textbox
int id = this.CategoryID;
// Use it with the view to find the index
int idx = viewCategories.Find(id);
// Use the index to set the Binding objects position
// This also cannot be referenced from here
BindingContext[dsWindowControlMaster, "Categories"].Position = idx;
Thanks for any ideas in advance.
Ant