WPF Create Datagrid/Table If The Data is Dynamically Changes
Hello, I am new to Q&A Microsoft, I used to see solutions in Social MSDN and I just know that the page migrated to Q&A.
I have a question. If I have data that will change every time, for example, today I will have 2 products and the program will create 3 tables for each detail.
Product 1
Date | Sales | Refund
1/3/2022 | 3 | 0
2/3/2022 | 4 | 2
3/3/2022 | 3 | 1
Product 2
Date | Sales | Refund
1/3/2022 | 2 | 1
2/3/2022 | 5 | 0
3/3/2022 | 3 | 2
Tomorrow, there will be 4 products and the program should create 4 tables.
Product 1
Date | Sales | Refund
1/3/2022 | 3 | 0
2/3/2022 | 4 | 2
3/3/2022 | 3 | 1
4/3/2022 | 2 | 1
Product 2
Date | Sales | Refund
1/3/2022 | 2 | 1
2/3/2022 | 5 | 0
3/3/2022 | 3 | 2
4/4/2022 | 2 | 0
Product 3
Date | Sales | Refund
1/3/2022 | 0 | 0
2/3/2022 | 0 | 0
3/3/2022 | 0 | 0
4/4/2022 | 2 | 0
Product 4
Date | Sales | Refund
1/3/2022 | 0 | 0
2/3/2022 | 0 | 0
3/3/2022 | 0 | 0
4/4/2022 | 4 | 0
In WPF, datagrid should be declared first, but how if I have dynamic data? Can WPF create dynamic tables too? Could you provide me with some example code? Thank you.