By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,340 Members | 1,642 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,340 IT Pros & Developers. It's quick & easy.

DataView

P: n/a
Using VS2005, VB.NET,
I know that I can use a DataView to constrain what rows are "seen"
from the underlying datatable - is it also possible to use a DataView
to constrain what columns/attributes "seen" from the underlying
datatable? If so, can you point me to an example.

Thanks for your attention to this...

Oct 18 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
As far as I know, you would have to create a separate datatable for each
possible set of columns you want to view. You can use the DataViewManager to
point a single dataview to each datatable, (assuming you add the datatables
to a dataset), then apply the row filter.

Use
MyDataView.DataViewManager.DataSet = MyDataSet
to point to the dataset that contains the DataTables.

Use
Dim dvs As DataViewSetting = MyDataView.DataViewManager. _
DataViewSettings("MyTableName") '(overloaded with 3 parameter types)
to point to the datatable containing the columns you want viewed,

Then Use
dvs.rowfilter = your selection criteria
to apply a rowfilter to the DataViewSetting's underlying DataView.
"hzgt9b" wrote:
Using VS2005, VB.NET,
I know that I can use a DataView to constrain what rows are "seen"
from the underlying datatable - is it also possible to use a DataView
to constrain what columns/attributes "seen" from the underlying
datatable? If so, can you point me to an example.

Thanks for your attention to this...

Oct 19 '07 #2

P: n/a
Another possibility, if your users are viewing the DataView through a
DataGrid, would be to dynamically add and remove columns from the grid, or
dynamically resize the columns you want to exclude to zero.

"hzgt9b" wrote:
Using VS2005, VB.NET,
I know that I can use a DataView to constrain what rows are "seen"
from the underlying datatable - is it also possible to use a DataView
to constrain what columns/attributes "seen" from the underlying
datatable? If so, can you point me to an example.

Thanks for your attention to this...

Oct 19 '07 #3

P: n/a
Hi,

This has a simple answer, "No". There is in fact no need for that, because
all controls have the possibility to filter the columns. Beside that you can
create in the versions after 2003 a not dynamic copy of a datatable using
the dataview overloaded method for that.

Cor

Oct 19 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.