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 8490245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:03:47+00:00 2026-06-10T22:03:47+00:00

I have a list of data where each row is string string int. All

  • 0

I have a list of data where each row is string string int. All of my data comes from plists as I am porting an iOS app. I also have another list which is string int double.

I’m using this tutorial to create my own rows for the list box.

I do not want to create a class for the row data so I don’t have the Transaction class and am unsure how to do the binding using a list of List. I’ll know of course if I am string string int or string int double.

  • 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-10T22:03:48+00:00Added an answer on June 10, 2026 at 10:03 pm

    Any reason you don’t want to create a class type for your row? This will make your life a million times easier when working with XAML.

    Create a class type for your row and make it implement INotifyPropertyChanged. Once your class implements INotifyPropertyChanged, it is easy to bind to it in your view.

    Let’s assume you are following the MVVM pattern. This means you will have a View (which you are coding in XAML) and a ViewModel. This view model is going to be a class that implements INotifyPropertyChanged as well. In the constructor of the view, you will set the DataContext property to a new instance of your ViewModel class.

    Now for the list part. In the ViewModel, create an ObservableCollection<MyRow>. An ObservableCollection<T> is a collection type that too implements INotifyPropertyChanged. Or in your case, it sounds like you have a list of these items. If this is true, I recommend encapsulating the list with another custom class. It makes the binding more natural with the MVVM pattern. You can double-nest an ObservableCollection but you’ll have to make the decision whether or not that is easy to read and understand. For instance, ObservableCollection<ObservableCollection<MyRow>>. In the following example, I assume you create a class (MySet) to hold the rows as opposed to double-nested lists.

    Custom Row Class

    public class MyRow : INotifyPropertyChanged
    {
        public event PropertyChanged;
    
        private string _stringValue = string.Empty;
        public string StringValue
        {
            get { return _stringValue; }
            set
            {
                if( _stringValue != value )
                {
                    _stringValue = value;
                    if( PropertyChanged != null )
                    {
                        PropertyChanged( this, new PropertyChangedEventArgs( "StringValue" ) );
                    }
                 }
            }
        }
    
        // continue with the rest of your properties
    }
    

    Row Set Class

    public class MySet : INotifyPropertyChanged
    {
        public event PropertyChanged;
    
        private ObservableCollection<MyRow> _rows = null;
        public ObservableCollection<MyRow> Rows
        {
            get { return _rows; }
            set
            {
                if( _rows != value )
                {
                    _rows = value;
    
                    if( PropertyChanged != null )
                    {
                        PropertyChanged( this, new PropertyChangedEventArgs( "Rows" ) );
                    }
                }
            }
        }
    }
    

    View Model

    public class MyViewModel : INotifyPropertyChanged
    {
        public event PropertyChanged;
    
        private ObservableCollection<MySet> _rowSets = null;
        public ObservableCollection<MySet> RowSets
        {
            get { return _rowSets; }
            set
            {
                if( _rowSets != value )
                {
                    _rowSets = value;
                    if( this.PropertyChanged != null )
                    {
                        this.PropertyChanged( this, new PropertyChangedEventArgs( "RowSets" ) );
                    }
                }
            }
        }
    }
    

    Now in your XAML, you have some options on how you want to display the nested nature of the list. I recommend the ItemsControl container. All you have to do is set the ItemsSource to your ViewModel’s property name and then override the DataTemplate. If you do this, then each item will have the data context of the inner list. Repeat with another ItemsControl and then you’ll have the item context be equal to each of the inner items (MyRow).

    View’s XAML

    <ItemsControl
        ItemsSource="{Binding Path=RowSets}" >
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <ItemsControl
                    ItemsSource="{Binding Path=Rows}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <TextBlock 
                                Text="{Binding Path=StringValue, Mode=OneWay}"
                                Margin="5,0,0,0"
                                />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
    

    And don’t forget to set the DataContext of the view to the ViewModel.

    View’s Code Behind

    public class View : UserControl
    {
        public View()
        {
            InitializeComponents();
    
            this.DataContext = new ViewModel();
        }
    }
    

    The code above is not tested and only gives you a general idea of where to go with this.

    Update

    If you aren’t wanting to create a class but merely bind to an array, you can do this too. The binding path allows for indexer syntax. You can enter in the XAML Text="{Binding Path=MyArray[0]}".

    If you have an array of an array, the XAML could look as follows:

    <ItemsControl ItemsSource="{Binding Path=MyOuterArray}">
        <ItemsControl.ItemTemplate>
            <!-- The data context here is the inner array so the indexer are applied to the inner array -->
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=[0]}" />
                <TextBlock Text="{Binding Path=[1]}" />
                <TextBlock Text="{Binding Path=[2]}" />
            </StackPanel>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
    

    A couple other options are to use Converters to translate the values in the array into some string format or to provide a property on the row class that is responsible for formatting the members appropriately. Are you just printing the array elements as strings in a sequence? Then just create a custom property on the row class called ‘FormattedValue’ and have it return the ToString() concatenation of all the relevant properties.

    public class MyRow : INotifyPropertyChanged
    {
        // ...
    
        public string FormattedValue
        {
            get 
            {
               return string.Join( ", ", this.MyArray );
            }
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of core data objects each has a longitude and latitude
I have a list of data that is a schedule. Each item has a
I have a list of states, each with some data associated with it, displayed
I have made a test with 10 M rows of data. Each row has
I have a jQuery UI selectable list: http://jqueryui.com/demos/selectable/ each row I generate has a
My problem is this; I have to order a table of data. Each row
I have a list of data points (0.2, 0.8, 0.95) that I want to
I have a list of data in javascript that looks like this: [[152, 48,
I have a list of data of the form: [line1,a] [line2,c] [line3,b] I want
I have a list and I want to extract to another list the data

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.