0

I have 10 Listboxes and an array of 1000 Lists of string. I need to fill the listboxes from the Array dpending on the Array Index. Is this possible with binding or have to do it manually?

1
  • Provide more information with code snippets. Commented Mar 7, 2011 at 13:12

2 Answers 2

1
<ListBox ItemsSource="{Binding MyArrayOfLists[0]}".../>
<ListBox ItemsSource="{Binding MyArrayOfLists[1]}".../>
<ListBox ItemsSource="{Binding MyArrayOfLists[3]}".../>
...

Is that what you mean?

Sign up to request clarification or add additional context in comments.

2 Comments

<ListBox ItemsSource="{Binding MyArrayOfLists[Index]}".../> <ListBox ItemsSource="{Binding MyArrayOfLists[Index+1]}".../> <ListBox ItemsSource="{Binding MyArrayOfLists[Index+2]}".../> So this is not possible right?
@Moonwalker031 - In the binding expression you can only specify constant values (as in my example). Expressions will not work.
0

I mean this statment is not possible right in XAML? But can it be done through code?


I have listboxes named listBox1, listBox2, listBox3 etc. Is there a way to name then like an array - listbox[1], listbox[2], listbox[3] - so that I can access them like an array - listBox[Index]?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.