Solved

DataViews and DataSets

Posted on 2004-08-10
3
311 Views
Last Modified: 2010-04-23
Hi there,
I'm new at VB.Net and just have a few questions regarding the way one should create a 'Lookup' screen. For example a screen for a user to search for 'Purchase Orders'
If I have a screen with several fields used as criteria for the rows displayed in the DataGrid, should I use a dataview as the source of the datagrid and set the RowFilter and Sort properties of the Dataview? Can I dynamically build the RowFilter property?
Do I need to 're-Fill' the dataset after setting the Dataview.RowFilter property?

Here is an example of what fields might be on the screen.

A combo box populated with possible Purchase Order statuses.
Two DatePicker combo boxes.
Another combo box which may have different criteria to search by and a text box next to it to type the criteria.
Eg. 'Purchase Order No' and the user can put in the first few digits of the purchase order no.
'Approved By' and the user can put in a name so that the purchase orders displayed are only those created by that name.
etc.

Any help on how to do this or if anyone can point me towards some examples/code for this would be much appreciated.

Thankyou and Regards,
Marnie.
0
Comment
Question by:MarnieHook
  • 2
3 Comments
 
LVL 4

Expert Comment

by:srcalc
ID: 11769180
To answer your first questions: Yes, I would suggest using the DataSet.DefaultView dataview object, it is much more flexible then just the dataview. Yes, you can change the RowFilter property during runtime and you do not need to re-fill. For help with your form controls, you may want to start with this example:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=1AA0FA40-8CDC-41F0-8710-A5826FBBD92E
0
 

Author Comment

by:MarnieHook
ID: 11780736
Hi Srcalc,
Thankyou for your response.
I am still stuck on this one and have posted what is probably a more specific problem with my code.
Your example is more for filling a combo box. I'm trying to filter data in a datagrid which has a dataview as it's datasource.
I'm sure I'll get there soon!!
Thanks again for your help.
Rgads,
Marnie.
0
 
LVL 4

Accepted Solution

by:
srcalc earned 50 total points
ID: 11784810
Can't use just change the rowfilter property of the dataview?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question