iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Is there a way to retieve the list of the selected items (displayed field) from the UXListBox when more than one item is selected?
Casting to UXListBoxItem only works if the UXListBox is in Unbound mode. In your case, the UXListBox is bounded to a collection of object. In such case, you will need to cast the item to the Object of the collection.
Attached is a simple sample which demonstrate such scenario.
You could iterate the SelectedItems property in order to retrieve the selected items from the list box. In the unbound mode, each object will need to be cast to UXListBoxItem, here is the snippet:
private void uXButton1_Click(object sender, RoutedEventArgs e){ string test = ""; foreach (UXListBoxItem item in (IEnumerable<object>)uXListBox1.SelectedItems) { test += (string.IsNullOrEmpty(test) ? "" : ", ") + item.Content.ToString(); } MessageBox.Show("Selected item: " + Environment.NewLine + test);}
Glenn;
Thanks for your answer. Is detailed documentaion on how to construct the UXListBox? I am not sure how to go about casting each object to UXListBoxItem. I have created the content of my UXListBox with the following code:
private void LoadData3()
{
PSSLServiceRef.PSSLServiceClient client = new PSSLServiceRef.PSSLServiceClient();
client.GetProjectsCompleted += new EventHandler<GetProjectsCompletedEventArgs>(client_GetProjectsCompleted);
client.GetProjectsAsync();
}
void client_GetProjectsCompleted(object sender, GetProjectsCompletedEventArgs e)
try
this.listBox3.ItemsSource = e.Result;
this.listBox3.DisplayMemberPath = "ProjectName";
catch (DataServiceQueryException ex)
this.tb1.Text = string.Format("Error: {0} - {1}",
ex.Response.StatusCode.ToString(), ex.Response.Error.Message);
Thanks,
Al
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname