Solved

DataViews and DataSets

Posted on 2004-08-10
3
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

742 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