J
Jerry
Hi,
I have a couple of datagrids that are based on dataviews.
If I filter dataview1 I would like to automatically filter
dataview2. I posted something about this before but I
think I didn't specifically focus about that I was using
dataviews and just datagrids. Ken Tucker was nice enough
to share an example using datagrids and
relations/constraints from code (thanks ken). I was able
to duplicate this example using components and physical
datasets/tables, physical connection, etc. I kind of have
the idea now about using this like
datagrid2.SetDatabinding(dataset1, "tbl1, tbl1tbl2")
which restricts the 2nd datagrid (based on tbl2) from a
selection from the first datagrid (based on tbl1). I
guess in the dataviews you use Rowfilter to restric rows.
So if I filter dataview1 on some field, I get x number of
rows. This gives me some unique row IDS. I then want to
filter dataview2 based on this list of ID's. This is not
the problem:
dataview2.RowFilter = "ID In (" & strCriteria & ")"
where strCriteria contains the list of IDs which I get
from a loop from the rows in dataview1. It just seems a
little kludgy. The question is if I can restrict the
datatable of dataview2 at the source rather than using
RowFilter. Can this be done the same way as a datagrid
binding to the relation? Is the dataview limited to the
RowFilter or is there a way to constrain the dataview
datasource at the source table level?
Thanks,
Jerry
I have a couple of datagrids that are based on dataviews.
If I filter dataview1 I would like to automatically filter
dataview2. I posted something about this before but I
think I didn't specifically focus about that I was using
dataviews and just datagrids. Ken Tucker was nice enough
to share an example using datagrids and
relations/constraints from code (thanks ken). I was able
to duplicate this example using components and physical
datasets/tables, physical connection, etc. I kind of have
the idea now about using this like
datagrid2.SetDatabinding(dataset1, "tbl1, tbl1tbl2")
which restricts the 2nd datagrid (based on tbl2) from a
selection from the first datagrid (based on tbl1). I
guess in the dataviews you use Rowfilter to restric rows.
So if I filter dataview1 on some field, I get x number of
rows. This gives me some unique row IDS. I then want to
filter dataview2 based on this list of ID's. This is not
the problem:
dataview2.RowFilter = "ID In (" & strCriteria & ")"
where strCriteria contains the list of IDs which I get
from a loop from the rows in dataview1. It just seems a
little kludgy. The question is if I can restrict the
datatable of dataview2 at the source rather than using
RowFilter. Can this be done the same way as a datagrid
binding to the relation? Is the dataview limited to the
RowFilter or is there a way to constrain the dataview
datasource at the source table level?
Thanks,
Jerry