Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a multi select list box that is bound to a datatable. I am trying to

retrieve the user's selections from the list box. I am using the code below.

 

foreach (System.Data.DataRowView item in lstServices.SelectedItems)

{

MessageBox.Show(item.ToString());

}

 

The message box displays System.Data.DataRowView. How do I get it to

display the actual value of the selected item - both the display value and

the bound value? Thanks for your help.

 

Weste

Posted

I solved my problem. I changed my code as follows and it worked.

 

MessageBox.Show(item.Row.ItemArray[0].ToString() + " - " + item.Row.ItemArray[1].ToString());

 

Weste

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...