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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:12:14+00:00 2026-05-31T03:12:14+00:00

I have a file in which the first line is a phone and the

  • 0

I have a file in which the first line is a phone and the second is a date.
I read the file and add the content to a listbox fine and everything is in a different row.
Now i changed the listbox to contain 2 textboxes.

<ListBox Name="listBox1" ItemsSource="{Binding}">
  <DataTemplate>
        <StackPanel>
               <TextBlock Text="{Binding Phone}" FontSize="32"/>
               <TextBlock Text="{Binding MyDate}" FontSize="16"/>
        </StackPanel>
  </DataTemplate>

How to bind the data from the file?
Thank you

  • 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-05-31T03:12:16+00:00Added an answer on May 31, 2026 at 3:12 am

    Create a class to represent your data:

    class PhoneDate
    {
     public string Phone{get;set;}
     public DateTime MyDate{get;set;}
    }
    

    Then load your data into a list

    List<PhoneDate> data = //load
    

    Finally bind the list to the listbox:

    listBox1.ItemsSource = data;
    

    Now your bindings will work.

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

Sidebar

Related Questions

I have this file which I need to read the first bytes to check
I have a text file which has first line as below: j0W82LBrSdUbw Basically it
I have a file named a.txt which looks like this: I'm the first line
I have created a file argument.pl which takes several arguments first of which should
Some setup background first: I have a cronjob which runs a PHP file called
I have a text file which contains a time stamp on each line. My
I have a file, which holds phone number data, and also some useless stuff.
Say I have a text file to parse, which contains some fixed length content:
I have an XML file which I'm parsing with SimpleXML in php. The first
I have a file with a list of records which I parse one line

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.