473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DataView

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
3 2402
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug ...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
4
by: Martin Schmid | last post by:
I am trying to implement a DataView for a DataGrid so I can sort at runtime by clicking on column headers. My initial page load works... it displays the data However, when I click a column...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
3
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
5
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a...
0
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.