Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,
I have a .xaml window with separate columns and a different textblock in each column. I am adding data to each textblock with a foreach dynamically. Is there a way I can add data dynimcally so I can do a columnspan so the data can go across each column like a columnspan in the .xaml?
C#
<TextBlock x:Name="TxtProductQuantityData" Grid.Column="2" Grid.Row="4"/>
              <TextBlock x:Name="TxtProductTotalData" Grid.Column="3" Grid.Row="4"/>

          foreach(int quantity in receipt.ProductQuantity)
          {
              TxtProductQuantityData.Text += quantity + "\n";
          }
          foreach(decimal subtotal in receipt.ProductsSubtotal)
          {
              TxtProductTotalData.Text += subtotal + "\n";
          }


I would like to add a new value at the end of this foreach content that does a colspan.

What I have tried:

foreach data added and trying to do a columnspan dynamic but no luck
Posted
Updated 10-Dec-18 19:34pm

1 solution

I ended up just adding to the TextBlock.Text with += and using "\n" To move the data down. I kept the same TextBlock and just made it bigger instead of adding another one.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900