473,386 Members | 1,694 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,386 software developers and data experts.

WinForms and WebServices

If you develop WinForms or WebForms clients that consume webservices, and
display the results in a DataGrid, you may be interested in a helper class I
found recently. It is the CollectionView class described at:
http://dotnetjunkies.com/WebLog/bsbl.../02/24116.aspx

This can help with sorting and filtering of collections, when displayed in a
DataGrid.

A DataGrid is a powerful data display widget. One of the interesting things
you can do when binding a DataSet (data retrieved from a Data source like
Oracle, DB2, SQL Server) to a DataGrid for display, is filter and sort the
data to be displayed, through the DataView class.

Filtering and sorting is not so straightforward when binding a collection of
arbitrary objects to the DataGrid. This CollectionView helper class
provides the analog to the DataView, but for arbitrary collections.

Nice !

Example: suppose you retrieve 10,000 records from a web service. You now
have an array of typed objects. You can bind these to a DataGrid to display
the information, one row to an item in the array, one column for each field
in the base object type. But if you want to display, for example, only the
records that end in Odd numbers, or only the records that include
international addresses, or etc etc... that's tricky. If you want to sort
on various columns, that's also tricky. Doing both at the same time is
very tricky. The CollectionView lets you do these things.

I modified a few things from Brendan's code (which itself is a derivative of
Rocky Lotka's example)
- added filters for "Includes" and "NotIncludes"
- better support for filtering and sorting at the same time
- caching property descriptors (for performance)

here is the modified source
http://cheeso.members.winisp.net/src...lectionView.cs

here is an example showing its use (scenario: IE Cache Viewer, not
webservices client):
http://cheeso.members.winisp.net/dl/...-2005Jan06.zip

Enjoy,
-Dino

--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ OmitThis . m i c r o s o f t . c o m

Nov 23 '05 #1
0 2754

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases...
1
by: news.microsoft.com | last post by:
Hi just would like to know how to access a webservice from winforms. i know i probably have to use WebRequest etc, but could someone supply me with a sample or a location for a sample? Thanks...
3
by: Samuel R. Neff | last post by:
We're working on implementing a Command Pattern design with our application in order to help facilitate undo/redo. This is fine four user actions we control which basically means menu actions. ...
20
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for...
3
by: Richard | last post by:
I know there is a bit of discussion already about this subject, but I'd like to hear any thoughts about which might be a better way to go. I'm developing an app (actually converting an Access...
8
by: Komandur Kannan | last post by:
We have a smart device application running on handhelds(Symbol MC9000G). The backend is Oracle and a middle tier web services development done in Vb.net. We use pessimistic Locking due to...
4
by: 3Cooks | last post by:
I have a windows application written in Visual Basic 6.0 that is going to be redeveloped in dotNET. We are trying to decide if we should deploy using Webforms or Winforms and I need advice from...
2
by: smoog | last post by:
Hi, I have one dll that can be called by a Winforms or an Asp.Net application, and i would like to know how can i find this environment ?? In fact i want to know the SartupDirectory of these...
2
by: Alex | last post by:
is it possible to expose a webservice from a winform application ? i saw that on a MSDN Briefing and i can't find anything related on the web. the demo was for .net 3.0 but i think it is possible...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.