Re: Gridview Linq Query

Phil Sayers <[email protected]> Thu, 11 Sep 2008 11:51:52 -0400
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Any chance you can run the linq against the underlying datasource of the
grid and not the grid itself?

Does the underlying data source have those properties set "As Object" or as
the appropriate Type you are looking for?


-----Original Message-----
From: Discussion of development on the .NET platform using any managed
language [mailto:[email protected]]On Behalf Of Booth, Bill
Sent: Thursday, September 11, 2008 11:46 AM
To: [email protected]
Subject: [DOTNET-CLR] Gridview Linq Query


Hi All,
I am trying to run a Linq query on a GridView Rows Collection that will
select the distinct contents of one cell. The query below will do the
job; however, it uses late binding. The variables cust and customerList
are both object types. I just cannot seem to get around this.
Any advice will be appreciated.
Bill

Dim gridList As GridViewRowCollection = CustomerGrid.Rows


Dim customerList = From cust In gridList _
     Select cust.Cells(4).Text _
     Distinct

For Each i In customerList
      Debug.WriteLine(i)
Next

The information in this e-mail is confidential, may be legally privileged
and is intended solely for the addressee. If you have received this e-mail
in error, you are hereby notified that any use, distribution, or copying of
this communication is strictly prohibited.

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com