Please help

G

Guest

I have a textbox that holds a product code called txtDtlProdCode.Tex
I insert the values into SQLCE and populate a list view lstOrdersDt
I then check to see that the product code in txtDtlProdCode.Text is in lstOrdersDtl and throw a message if it exists
I then want to find and set the lstOrderDtl.FullRowSelect to the particular item in lstOrdersDtl. I want to do this without a DB Call. Can I

Can i use something along the lines of...
lstOrdersDtl.Items(lstOrdersDtl.SelectedIndices(0)).SubItems(0).Text(
 
A

Alex Feinman [MVP]

foreach( ListViewItem item in lstOrdersDtl.Items.Items )
{
item.Selected = item.Text == txtDtlProdCode.Text;
}

bool bFound = lstOrdersDtl.SelectedIndices.Count > 0;

Of course you can also match the text to the subitem text instead of item
text

--
Alex Feinman
---
Visit http://www.opennetcf.org
marcmc said:
I have a textbox that holds a product code called txtDtlProdCode.Text
I insert the values into SQLCE and populate a list view lstOrdersDtl
I then check to see that the product code in txtDtlProdCode.Text is in
lstOrdersDtl and throw a message if it exists.
I then want to find and set the lstOrderDtl.FullRowSelect to the
particular item in lstOrdersDtl. I want to do this without a DB Call. Can I?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top