Datatable - add column with autoincrement

i have a datable and i need to add the column with id, and autoincrement it.
It should be something like
newDT.Columns.Add(“Id”, …)
but i don’t know how to correct write expression.

It there is more interesting way - please tell me)
Thank you.

While adding the column, get the count of columns in a datatable, add +1 to the counter and pass as the column name.

1 Like


Refer the XAML Main.xaml (8.0 KB)


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