Add datarow or arrayRow at specific position in datatable

Hi,
I have a datatable . I want to add a empty row at last but one position. I tried using invoke method and used insertAt function but i am getting
“Invoke Code: Exception has been thrown by the target of an invocation.”
Please suggest me a solution.

Thanks in Advance

YourDatatable.Rows.InsertAt(newRow, index_where_you_wants_to_insert); // index 2
YourDatatable.Rows.InsertAt(newRow1, index_where_you_wants_to_insert); // index 0

InsertNewRow.xaml (7.1 KB)

1 Like

Hope these steps would help you to resolve this
you were almost done, i hope you would have tried to add datarow while looping or while the datatable is been accessed in the middle
–if we have the datatable named dt ready
–use a INVOKE METHOD like this
here you go with a sample xaml
invoke.zip (2.3 KB)

Cheers @Raju_Balla

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.