How can I use a DataTable to save data into it? I have a listView with ticks, and when a tick is checked, I would like to put the data of the row into DataTable.
In the row I have a "ProductName" and it`s "Price".
I am doing this becuase the user can change the content of the listView, so when it comes back to previous list, where he checked a row, I would like that the row remains checked.
The easiest way I came up with, is to save the ticked row into DataTable, and when users changes list`s content, I will check every time the content of the DataTable, and if there is a row in it which equals with the actual shown list in a listView, I will check the row.

Does this have any sence? Or is there any better way of ticking previousely ticked rows?

Part of the sample in .NET sdk.

// Once a table has been created, use the 
    // NewRow to create a DataRow.
    DataRow row;
    row = table.NewRow();

    // Then add the new row to the collection.
    row["fName"] = "John";
    row["lName"] = "Smith";
    table.Rows.Add(row);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.