Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:11:35+00:00 2026-06-11T07:11:35+00:00

I am having hard luck in trying to bind my property which is of

  • 0

I am having hard luck in trying to bind my property which is of type List to a ListBox through XAML. Note though that the list contains string arrays (string[]).

So the XAML part of code looks like this:

<ListBox Height="373" HorizontalAlignment="Left" Margin="9,65,0,0" Name="reservoirList" VerticalAlignment="Top" Width="546" 
                 ItemsSource="{Binding Wells}">
</ListBox>

and on the viewModel:

public ObservableCollection<string[]> Wells {
            get { return new ObservableCollection<string[]>(getWellsWithCoords()); }            
        }

where getWellsWithCoords() creates a list of string[].

When I ran the application what I see is – which makes sense:

string[] array
string[] array 
....

Is it possible to change the XAML code in such a way so that automatically on each row
I see the n values of the each element of the Wells list, i.e something like:

well1 value11 value12
well2 value21 value22
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:11:37+00:00Added an answer on June 11, 2026 at 7:11 am

    Add a template to your listbox:

    <ListBox Height="373" HorizontalAlignment="Left" Margin="9,65,0,0" Name="reservoirList" VerticalAlignment="Top" Width="546" ItemsSource="{Binding Wells}">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <!--Here you bind the array-->
            <ItemsControl ItemsSource="{Binding}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <!--Here you bind the value of each string-->
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Margin="5,0"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </DataTemplate>
    </ListBox.ItemTemplate>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying really hard to made this work, but I'm having no luck. I'm
Having hard time binding a list to the datagrid: XAML: <DataGrid Name=dgProductList ItemsSource={Binding ProductList}>
Have looked quite hard for this answer but having no luck. I have 3
I'm having hard time trying to figure out how to auto-save user data in
I'm having hard time trying to force https (ssl) to particular page on codeiginiter
I'm having hard time trying to set certain cell's value in table. Here is
i am having hard time determining the length of a Decimal data type. The
I am trying to load a flash object and I am having a hard
I am trying to write a Python program and I am having a hard
I having a hard trying to properly display Vietnamese text in ColdFusion. I've proper

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.