Solved

DataViews and DataSets

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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