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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:21:07+00:00 2026-06-09T16:21:07+00:00

I am very new in WPF. I have been trying to do the following:

  • 0

I am very new in WPF. I have been trying to do the following:

Following is the structure of my data:

public class TokenItems {public string items {get;set;} public int quantity {get;set}}
public class Token { public int tokenNo {get;set;} public string name {get;set;} public   List<TokenItems> currentItems {get;set;}}
public List<Token> tokenList = new List<Token>();

XAML:

<ItemsControl Name="ParentControl">
   ....
   <DataTemplate>
   <TextBlock Content="{Binding tokenNo}"/>

   <Itemscontrol Name="{Binding tokenNo}">  ?? I tried and want dynamic naming or any other solution for this {Binding name} just won't work i know.??
      ...
      <DataTemplate>
        <Button>
            <Grid>
               ...
               <TextBlock Content="{Binding items}/>
               <TextBlock Content="{Binding quantity}/>
      </DataTemplate>

   </Itemscontrol>
     ....
   </DataTemplate>
</Itemscontrol>

I added the all the necessary data to the tokenList and did the following:

ParentControl.ItemsSource = tokenList;

No doubt everything binded properly for the ParentControl. Now I want to fill it’s child Itemcontrol with the list currentItems. Since there’s going to me multiple parent control, I needed dynamic naming to the children Itemscontrol. Further I cannot access the children ItemsControl from code.

How to make that possible? I don’t know if there exist child ItemsControl of ItemsControl itself.

Please suggest me any solution or alternative solution to this problem.

EDIT: I want the user to see the Token Number, time, etc with the list of items that is to be replaced by list of interactive buttons.

Update: slightly modified the XAML content. The children ItemsControl is within the DataTemplate.

  • 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-09T16:21:09+00:00Added an answer on June 9, 2026 at 4:21 pm

    You shouldn’t need naming in the itemscontrol, if you want the itemscontrol to trigger something, use buttons in the itemtemplate:

    <ItemsControl ItemsSource="{Binding tokenList}">
       <ItemsControl ItemsSource="{Binding currentItems}">
           <ItemsControl.ItemTemplate>
               <DataTemplate>
                   <Button Content="{Binding TokenNo}"/>
               </DataTemplate>
           </ItemsControl.ItemTemplate>
       </ItemsControl>
    </ItemsControl>
    

    You vould add whatever you need to show in the datatemplate tag. In my example, the text on the button will be the TokenNo it finds in the parent, being the Token that’s shown through the tokenlist binding.

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

Sidebar

Related Questions

I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and
So I am very new to WPF and trying to bind or assign a
I have been using WPF for a new project which is far from done.
I am (very) new to WPF and I have got a question regarding that.
I am very new and very inexperienced. I have downloaded a WPF version of
I am very new in WPF. I have created a form style in Wpf
I'm very new to WPF, so please bear with me. Basically I have defined
I am very new to WPF and am trying to set up an application
I am somewhat new to WPF and Data Binding, it seems very powerful. I'm
In my application (WPF) i have this window: public partial class Window1 : Window

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.