Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
Ok so you want to directly replace the data in the dataset which is shown on the widget?

Perhaps you can grab each DataRow for each driver and update the value for the appropriate column. I think that may work, but I cannot test it right now.

Something like this. Suppose your identifier is the car number and it is in column 0, and suppose the champ points is in column 5:
// Columns
var colId = 0;
var colPoints = 5;

// Spreadsheet
var spreadsheet = item.Theme.Spreadsheets.Find("x.csv");

// Loop through results
foreach (var result in results)
{
// Find row for this car
DataRow row = spreadsheet.FindRow(result.Entity.Car.CarNumber, colId);

// Calculate new points somehow
var newPoints = 123;

// Set the value for the appropriate column
row[colPoints] = newPoints;
}

This will reset whenever the spreadsheet is reloaded (theme restart or you somehow change any of its properties via a script).