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

Using LINQ to see if Item already exists in listview

Gaz
Im trying to use c# and linq to simplfy searching through a listview
but cannot get it to work can anyone help?
here is what i got so far which doesnt work.

var qry = from L in listviewname.items.all

where l.item.value == "123"

Select L.item.value;

Thanks Gary
Mar 19 '08 #1
2 4653
Gaz
ok i will start again...

Im trying to learn LINQ and im not sure if im going about this in the
correct method.

I want to query all the items in the listview collection where the
item key value in the collection is equal to what i tell it..

This is my code..

var qry = from itm in uListSelected.Items
where itm.key == "1"
Select itm.key;

foreach (var Result in qry)
{
return true;
}

Is this bit more helpful?
Mar 19 '08 #2
Gaz
its to replace this
foreach(Infragistics.Win.UltraWinListView.UltraLis tViewItem Itm in
uListSelected.Items)
{

if (KeyID == Convert.ToString(Itm.Key))
{
return true;

}

}
Mar 19 '08 #3

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

Similar topics

19
by: Kamilche | last post by:
I have looked at many object-oriented programming frameworks out there for C. Though the ideas presented are intriguing, and I've used some of them in my own work, they all suffered some drawback...
1
by: RonNanko | last post by:
I am facing a userinteraction issue with a listview, which is populated/updated by a background task. While the population of the listview is taking place, the user should already be able to...
3
by: Tiago Salgado | last post by:
I everyone... I've got a listview (details) ... and i'm trying to unselect any item selected... In a combobox, e.g, i can put this: ComboBox1.SelectedIndex = -1 I want to do this but in a...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
0
by: =?Utf-8?B?UmFzbXVz?= | last post by:
I have a simple LiveView control that databinds to a LinqDataSource that maps to a table like this: CREATE TABLE MyTable (Id int NOT NULL, Name nvarchar(50) NULL, Picture image NULL) The OR...
1
by: shapper | last post by:
Hello, I have a ListView where I use LINQ for data, for example, selecting, and deleting. In the ListView item template I added a DataPager. When I click, for example, "Next Page" or a page...
0
by: Alan Mailer | last post by:
I have a ListView in one of my VB.Net applications. I don't want to Disable this ListView... but there are times I want to prevent the User from selecting a ListView Item other than the one that...
0
by: Lloyd Sheen | last post by:
I was in a thread talking about how to populate a listview from a Linq query. This got my curiosity up so I created a usercontrol which is a listview which can be populated from a Linq query. I...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a ListView in which each item is an array of 5 strings. I add these string arrays to the ListView by doing the following, where "result" is the array of 5 strings to add: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.