Solved

DataViews and DataSets

Posted on 2004-08-10
3
308 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now