|
-
Mar 26th, 2004, 05:25 PM
#1
Thread Starter
Lively Member
ListView Item Pls help
Hello Everybody:
I am working on two ListView Control. I have 10 client details(client name and phone number) stored in one ListViewControl. I have the address of 10 clients stored in another ListViewControl...Now I want to select the information for say 5th Client(name and phonenumber) and its corresponding address in the second listbox and display it on a textbox. I want to select the correct client name and telephone in the first list View and its corresponding address in the second ListView Control. If I select the wrong address or wrong client name, it should display an error message
For e.g.
The client details (name and phone number) is being added into listview1 as
Client 1
Client 2
Client 3
Client 4
Similarly the address in listview 2 is being added as
Address 1
Address 2
Address 3
Addres 4
Now I want to select Client and Address in such a way that Client 1 should correspond to Address 1 only, Client 2 should corresspond to Address 2 only.
The code I have written for it is
private void ListViewHashCode_Click(object sender, System.EventArgs e)
{
for( int i = 0 ;i< this.ListViewHashCode.Items.Count ;i++)
{
if (ListViewHashCode.Items[i].Checked == true)
{
//this.txtDataTx.Text=listViewThread.CheckedItems[0].Text;
Object objData = listViewThread.CheckedItems[0].Text;
byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString ());
m_socWorker.Send (byData);
}
}
}
When I use this code ,only the Address 1 is selected inspite of checking Client 1,Client 2.
I will appreciate if anyone can guide me with this..
K
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|