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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:00:57+00:00 2026-06-17T21:00:57+00:00

Databinding still confues me and I am not sure how to essential make these

  • 0

Databinding still confues me and I am not sure how to essential make these controls repeat for each bound piece of data I have.

   <Grid>
                <TextBlock FontSize="25" Text="this is a header"></TextBlock>
                <TextBlock Height="30" HorizontalAlignment="Left" Margin="19,36,0,0" Name="txt" Text="line under the header" VerticalAlignment="Top" />
                <TextBlock Height="30" FontSize="25" HorizontalAlignment="Left" Margin="306,9,0,0" Name="textBlock2" Text="530" VerticalAlignment="Top" Width="91" />
                <TextBlock Height="30" HorizontalAlignment="Left" Margin="305,42,0,0" Name="textBlock3" Text="30" VerticalAlignment="Top" Width="91" />
            </Grid>

enter image description here

If my data source would have a count of 50. I would expect to see 50 of these groupings(I probably need to get a scroll bar though).

Not sure how to do this though. I need some sort of datatemplate I guess? Also “line under the header” should be clickable and highlight.

  • 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-17T21:00:58+00:00Added an answer on June 17, 2026 at 9:00 pm

    I think you need to use the control named “ItemsControl”. Not a derived class, not a ListBox, just plain simple ItemsControl.

    Either in code or in XAML, you set the ItemsControl’s ItemsSource property to any collection containing your items.

    In XAML (either in VS or Blend, to do it WYSIWYG in Blend you must somehow provide design data) you set the ItemsControl’s ItemTemplate to a DataTemplate that contains the XAML subtree you want to repeat for every item in your collection.

    Inside the DataTemplate, replace “line under the header” with the Button control, with Content="line under the header", and style it however you want. Then, add CallMethodAction to your button. It only takes 2 clicks in Blend, the first one is on “Assets” window. Specify TargetObject="{Binding}" MethodName="actSubtitleClicked". This way, the framework will call the void actSubtitleClicked() method of the item where user clicked the “line under the header”.

    For best performance, you should also modify the ItemsControl’s ItemsPanel template, replacing StackPanel with VirtualizingStackPanel (again, a few clicks in Blend, the first one is the right click, then “Edit additional templates / ItemsPanel / Edit a copy”)

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

Sidebar

Related Questions

When doing databinding does one have to implement INotifyPropertyChanged on the datacontext in WPF?
I have a ListBox with databinding. I need to fire an event when a
Possible Duplicate: Using ASP.NET Controls without databinding My previous question yielded few results so
Just learning WPF databinding and have a gap in my understanding. I've seen a
Still new to LINQ2SQL so please forgive my ignorance ... I have one user
I'm building a Spring MVC app with Spring 3.0.3. I have data binding of
Morning folks, I'm still trying to get my head around databinding in WPF and
I have tried several methods among others that do not seem to work: ASPxTreeList
I have an ADO .Net Entity Data Model for my database. In this Model
My understanding of DataBinding is still at the working on it level, so 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.