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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:17:03+00:00 2026-06-14T10:17:03+00:00

Original question was here. Binding To A ListView I have fixed one issue and

  • 0

Original question was here.
Binding To A ListView

I have fixed one issue and now see the column names. However, I can’t figure out the binding.

The error from the output window:

 System.Windows.Data Error: 4 : Cannot find source for binding with reference 
'ElementName=This'. BindingExpression:Path=LogView.LogEntries; DataItem=null; target 
element is 'ListView' (Name='LoggingListView'); target property is 'ItemsSource' (type     'IEnumerable')

Snippet of the XAML with my latest attempt from LogFileWindow.XAML. I can post more but trying to keep the clutter down:

   <ListView Name="LoggingListView" ItemsSource="{Binding ElementName=This,  Path=LogView.LogEntries}  ">
                        <ListView.View>
                        <GridView>
                            <GridViewColumn Header="Date" DisplayMemberBinding="{Binding Path=Date}"></GridViewColumn>
                            <GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=Time}"></GridViewColumn>
                            <GridViewColumn Header="Event" DisplayMemberBinding="{Binding Path=Event}"></GridViewColumn>
                        </GridView>
                        </ListView.View>
                    </ListView>

The C# ViewModel:

public class LogEntryViewModel : INotifyPropertyChanged
{
   public LogEntryViewModel(LogFileEntry le)
    {
        _date = le.Date;
        _time = le.Time;
        _event = le.Event;
    }     
    #region Members
    private string _date;
    public string Date
    {
        get { return _date; }
        set {_date = value;
        RaisePropertyChanged("Date");           
        }
    }

    private string _time;
    public string Time
    {
        get { return _time; }
        set
        {
            _time = value;
            RaisePropertyChanged("Time");

        }
    }

    private string _event;
    public string Event
    {
        get { return _event; }
        set { _event = value;
        RaisePropertyChanged("Event");
        }
    }
    private LogFileEntry _le;
    #endregion

    #region INotifyPropertyChanged Members

    public event PropertyChangedEventHandler PropertyChanged;

    #endregion

    private void RaisePropertyChanged(string propertyName)
    {
        // take a copy to prevent thread issues
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

public class LogViewModel :ObservableCollection<LogEntryViewModel>
{
       private ObservableCollection<LogEntryViewModel> _LogEntries;
    public ObservableCollection<LogEntryViewModel> LogEntries = new    
  ObservableCollection<LogEntryViewModel>();

}

Partial Class declaration and code-behind where I am trying to use it:

public partial class LogFileWindow : Window
{
    public  LogViewModel LogView = new LogViewModel();

}

  • 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-14T10:17:05+00:00Added an answer on June 14, 2026 at 10:17 am

    The Visual Studio error is pretty self-evident and self explanatory: you’re trying to do Binding with ElementName and searching for a visual element (supposedly defined in your XAML visual tree) with Name=”This”. There’s no such thing (apparently, I couldn’t tell because you didn’t post the complete XAML tree).

    If you want to bind a Visual Element Property to another Property in the same element you have you use RelativeSource Self

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

Sidebar

Related Questions

My original question can be found here , for which I've gotten some great
Ok, here was my original question; Table one contains ID|Name 1 Mary 2 John
Edit: original question below, but I revise it now that I have some code
REVISED QUESTION (SEE BELOW FOR ORIGINAL): Here is an example of a simple ajax
See my original question here . This works great if you are using Outlook
My original question is here , which no one seems interested in. I've decided
I have another question about binding using C# and the entity framework. Here, I'm
This question is sort of a follow-up to my original question here . Let's
I asked the original question here , and got a practical response with mixed
EDIT: I figured out the answer to the original YUI3 question I posted here,

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.