Appending Data Table


#1

Having a nightmare and its going to be so simple

How each row in a table already created
I have a dialog box open asking to enter a price with what ever is in the second column name
The entered price should then append to the correct row

When the dialog box comes up its asking me to enter the same price twice then appends the wrong row in the table


#2

Row index is hard coded. So every time first row will be updated. Use a variable and increment it every time.


#3

I think you need to update data table, to append means adding something at the end. See this

and to add a data row you can simply use Add Data Row


#4

Hi there @Jersey_Practical_Sho,
I’m not sure I fully understand your request, but you may be able to resolve your problem by updating your Assign to be:
Assign - row.Item("Your Column To Have Data Written To") = Price

Thanks in advance,
Josh


#5

Cool that part works thank you.

The only other part is

When asking to input the prices it shows the same entered value for each row even though they are different

image


#6

You are not updating DT_DATA_SName in the loop. How you are assigning value to that variable?


#7

I’ve just figured that is the problem :frowning:

So in another sequence

A datatable is created with 3 Columns Name SName and SPrice

Then 2 dialog boxes populate the first 2 columns

The part above I want it to for each row
show a dialog box with the SName and have the price entered and added to the table

its the showing of the SName im having trouble with

tried this but get the exclamation

image


#8

Then Instead of that variable, directly use datatable.row(“sname”)


#9

Now I have


#10

TableName.Rows[RowIndex][“ColumnName”].ToString()


#11

Hi there @Jersey_Practical_Sho,
Apologies, would you be able to provide a snippet of your XAML.

Thanks once again,
Josh


#12

Example.xaml (7.4 KB)


#13

Hi there @Jersey_Practical_Sho,
If I am understanding correctly, you simply need to add the following within the label:

row.Item("SName").ToString

Thanks once again,
Josh


#14

Awesome thanks guys!