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

  • Home
  • SEARCH
  • 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 506813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:44:23+00:00 2026-05-13T06:44:23+00:00

In WPF app I have a WCF service which dynamically fills a generic List

  • 0

In WPF app I have a WCF service which dynamically fills a generic List object from a backend database.

How in this case (List created in runtime), I could bind List items to a ListView object items?

It is the Data contract for my Web service:

....
[DataContract]
public class MeetList
{
    [DataMember]
    public string MeetDate;
    [DataMember]
    public string MeetTime;
    [DataMember]
    public string MeetDescr;

 .....

 static internal List<MeetList> LoadMeetings(string dynamicsNavXml)
    {
        ...// Loads  XML stream into the WCF type
    }

Here in this event handler I read the WCF service and Loop through a List object:

       private void AllMeetings()
    {
        Customer_ServiceClient service = new Customer_ServiceClient();
        foreach (MeetList meet in service.ReadMeetList())
        {
            ?????? = meet.MeetDate; // it's here that I bumped into a problem
            ?????? = meet.MeetTime; //
            ?????? = meet.MeetDescr;//
        }

    }

My Listview XAML:

                            <Grid>
                                <ListView Height="100" Width="434" Margin="0,22,0,0" Name="lvItems" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" SelectionMode="Single">
                                    <ListView.View>
                                        <GridView>
                                            <GridViewColumn Header="Date" Width="100" HeaderTemplate="{StaticResource DateHeader}" CellTemplate="{DynamicResource DateCell}"/>
                                            <GridViewColumn Header="Time" Width="100" HeaderTemplate="{StaticResource TimeHeader}" CellTemplate="{DynamicResource TimeCell}"/>
                                            <GridViewColumn Header="Description" Width="200" HeaderTemplate="{StaticResource DescriptionHeader}" CellTemplate="{DynamicResource DescriptionCell}"/>
                                        </GridView>
                                    </ListView.View>
                                </ListView>
                            </Grid>

And data templates for this ListView:

<Window.Resources>
    <DataTemplate x:Key="DateHeader">
        <StackPanel Orientation="Horizontal">
            <TextBlock Margin="10,0,0,0" Text="Date" VerticalAlignment="Center" />
        </StackPanel>
    </DataTemplate>
    <DataTemplate x:Key="DateCell" DataType="Profile">
        <StackPanel Orientation="Horizontal">
            <TextBlock>
                    <TextBlock.Text>
                        <Binding Path="MeetDate" />
                    </TextBlock.Text>
            </TextBlock>
        </StackPanel>
    </DataTemplate>
......

How in this case (List created in runtime), I could bind my generic List items to a ListView object items?

I tried to use lvItems.ItemsSource = profiles; , but it doesn’t work in my event handler

  • 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-13T06:44:24+00:00Added an answer on May 13, 2026 at 6:44 am

    List doesn’t have behaviour to notify that items count is changed. You should use a list with support INotifyCollectionChanged.. for example: ObservableCollection<T>. ObservableCollection<T> will inform your lvItems that items count is changed and it will be properly display.

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

Sidebar

Related Questions

Im building a WPF 3.5 desktop app that has a self-hosted WCF service. The
I have a wpf app that uses a wcf webservice. Its my webservice and
I have a WPF app. I need to embed a Silverlight app inside it.
I have a .NET 4 WPF app that gets installed using an MSI, generated
I have to create a simple app, that will suit as an example of
Here's my current scenario which is specifically what i'd like to discuss as a
I have a ListBox where I set the ItemsSource to a CollectionViewSource that is
I was looking for some current opinions on WPF based on their 4.0 release.
What are some options for implementing a chat feature in a C#/WPF desktop application?
I am in the process of designing an API. I would like to know

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.