Filter dataset columns

  • Thread starter Thread starter SPG
  • Start date Start date
S

SPG

Hi,

I need to be able to filter the columns that are visible through a dataset.
That is, I can have all columns in a dataset, but only some of them are
visible when filtered.

I know you can use rowfilter on a dataview. Is there anything like that I
can use?

Steve
 
Hi,
I think that you mean datatable columns, not dataset columns.

You cannot filter columns as you filter rows, you have to go with a
workaround, you can create a new table with the column structure you need,
then using the DataColumn.Expression you can make reference to the original
table. Please make sure to include a FK relationship between both tables,
having the temp table as the child end, then Expression can be like
Parent.Name

Then you need to fill the table and you can use this new table as a "view".

Cheers,
 

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

Back
Top