I have made a code which makes few lists. In the end i get the following lists:
List<int> list_AmountNeed = new List<int>();
List<int> list_TotalCost = new List<int>();
List<int> list_TotalLose = new List<int>();
List<int> list_TotalGain = new List<int>();
after few calculations these lists contain values (24 in each if it matter):
while (z < list_Exp.Count)
{
list_AmountNeed.Add((goalexp - currentexp) / Convert.ToInt32(list_Exp[z]));
list_TotalLose.Add(list_AmountNeed[z] * (list_Amount_MadeFrom_One[z] * list_BuyPrice_MadeFrom_One[z] + list_Amount_MadeFrom_Two[z] * list_BuyPrice_MadeFrom_Two[z]));
list_TotalGain.Add(list_AmountNeed[z] * list_AmountMade[z] * list_SellPrice[z]);
list_TotalCost.Add(list_TotalGain[z] - list_TotalLose[z]);
z++;
}
Now, i have made a UI containing a button and Datagrid using blend and i want those lists to be shown in the Datagrid columns once i click the button.
what i did so far is inserting this code into the button xaml.cs. the thing im not sure how to do is if i can write the displaying code inside the button xaml.cs or it have to be in the datagrid and whats the right code to show it in columns:
column 1:
list_AmountNeed
column 2:
list_TotalCost
and so on.
Thank you!
