RowFilter not working...pls help

  • Thread starter Thread starter Bamse
  • Start date Start date
B

Bamse

hi, i have this situation:
1 gridDocs binded to a table,
1 gridRev + several controls binded to a dataset, which does not contain the
above mentioned table;

i want that when i select a row in gridDocs, get the id of the selected
document and pass it to the RowFilter of the gridRev;
then, the gridRev shows only the corresponding child rows.

gridRev.Tables["Revisions"].DefaultView.RowFilter = "DocID = " + selectedID;

and this it doesn't work. i also tried with DataViewManager, and didn't work
either.

i cannot use 2 tables within a dataset, with relations and the usual stuff
(because of the design).

please help,

Daniel
 
Try creating a new DataView, setting the row filter for it, and adding it to
the dataviews for the dataset.

I'm not sure this will work, but this is how it's done in the MSDN sample
from the docs:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/cpref/html/frlrfSystemDataDat
aViewClassRowFilterTopic.htm

Pete
 
thanks, i've read that topic; it doesn't work;
the example i tried is
http://www.akadia.com/services/dotnet_filter_sort.html
but without results

Pete Davis said:
Try creating a new DataView, setting the row filter for it, and adding it to
the dataviews for the dataset.

I'm not sure this will work, but this is how it's done in the MSDN sample
from the docs:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/cpref/html/frlrfSystemDataDat
aViewClassRowFilterTopic.htm

Pete
--
http://www.petedavis.net


Bamse said:
hi, i have this situation:
1 gridDocs binded to a table,
1 gridRev + several controls binded to a dataset, which does not contain the
above mentioned table;

i want that when i select a row in gridDocs, get the id of the selected
document and pass it to the RowFilter of the gridRev;
then, the gridRev shows only the corresponding child rows.

gridRev.Tables["Revisions"].DefaultView.RowFilter = "DocID = " + selectedID;

and this it doesn't work. i also tried with DataViewManager, and didn't work
either.

i cannot use 2 tables within a dataset, with relations and the usual stuff
(because of the design).

please help,

Daniel
 
the binding is made like that:

gridRev.SetDataBinding(dataset, "Docs.Docs2Revisions");

where the dataset is the DataSource and
"Docs.Docs2Revisions" is the DataMember
(ParentTable.Relation)
 
Hi Bamse,

Try something like:
CurrencyManager cm = (CurrencyManager)BindingContext[dataset,
"Docs.Docs2Revisions"];

DataView view = (DataView)cm.List;

To get the right DataView.


--
Miha Markic [MVP C#] - DXSquad/RightHand .NET consulting & software
development
miha at rthand com www.rthand.com

Developer Express newsgroups are for peer-to-peer support.
For direct support from Developer Express, write to (e-mail address removed)
Bug reports should be directed to: (e-mail address removed)
Due to newsgroup guidelines, DX-Squad will not answer anonymous postings.
 
Back
Top