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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:42:23+00:00 2026-05-28T14:42:23+00:00

I’m having trouble binding values to dynamically created controls. When a user loads a

  • 0

I’m having trouble binding values to dynamically created controls. When a user loads a custom file and that file will have a unknown number of arguments. Arguments have a Group property that when grouped will dynamically add tabItems to a tabControl. I then loop through the arguments and add a label and, for now, a textbox to a grid inside the tabs. though i intend to use different controls depending on the arument type. I want to bind the argument Value property to the textbox. The tabs, labels and textboxes are added fine but, no value binding

He if my not yet re-factored solution so far;

    myTab.Items.Clear();

    var args = viewModel.Arguments;
    var groups = args.GroupBy(arg => arg.Groups);

foreach (var group in groups)
{
    TabItemExt tab = new TabItemExt();
    tab.Header = group.Key;

    Grid grid = new Grid();

    grid.ColumnDefinitions.Add(new ColumnDefinition());
    grid.ColumnDefinitions.Add(new ColumnDefinition());

    int count = 0;
    foreach (var argument in group)
    {
        RowDefinition newRow = new RowDefinition();
        grid.RowDefinitions.Insert(count, newRow);

        LabelTextBlock label = new LabelTextBlock();
        label.Text = argument.DisplayName;

        Grid.SetRow(label, count);
        Grid.SetColumn(label, 0);

        TextBox textBox = new TextBox();
        var binding = new Binding();
        binding.Source = viewModel.Arguments[argument.Name];
        //binding.Source = argument
        binding.Path = new PropertyPath("Value");

        textBox.SetBinding(TextBlock.TextProperty, binding);

        Grid.SetRow(textBox, count);
        Grid.SetColumn(textBox, 1);

        grid.Children.Add(label);
        grid.Children.Add(textBox);
        count += 1; 
    }

    tab.Content = grid;
    myTab.Items.Add(tab);    
}
  • 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-28T14:42:24+00:00Added an answer on May 28, 2026 at 2:42 pm
    textBox.SetBinding(TextBlock.TextProperty, binding);
    

    should have been

    textBox.SetBinding(TextBox.TextProperty, binding);
    

    just a little over dependent on intellisense.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a reasonable size flat file database of text documents mostly saved in
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't

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.