Selectively skip binding items

N

neverstill

Hi-

This must have been asked before, but I can't google it up.
I would like to run an expression on items as they are bound to a DataGrid,
then if the expression is true, allow the bind to happen, else... skip that
item. What is the best place to do this? I looked in ItemDataBound but
don't see an easy way to do it.

Is this possible?

any help would be great.

Thanks,
Steve
 
M

Micharel Tkachev

hi,

It's a very simple.
You can use RowFilter in the DataView.
E.g.:

string s = "Test";
DataView dv = bla-bla-bla;
dv.RowFilter = "ColumnName = '" + s + "'";

And now you have a dataview without bad rows.

Good luck.
 
N

neverstill

That is really easy! Thanks a lot
Micharel Tkachev said:
hi,

It's a very simple.
You can use RowFilter in the DataView.
E.g.:

string s = "Test";
DataView dv = bla-bla-bla;
dv.RowFilter = "ColumnName = '" + s + "'";

And now you have a dataview without bad rows.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,291
Messages
2,571,453
Members
48,137
Latest member
IndiraMcCo

Latest Threads

Top