If i have a list with four columns -
- string ProcessSteps
- bool IsNext
- bool ReachedCurrentPosition
- char IsTransacted
say there is 10 records - And I am looking for the value IsNext = true and that is on the 5th record in the list... i want to be able to change each record ReachedCurrentPosition to false, after that record. How would i achieve that? is linq feasable? Basically, i want to output a button, until at this point, which i then need to update the proceeding records (ReachedCurrentPosition = true), to not allow them to output a button.
@foreach (var steps in ProcessSteps)
{
<GridColumns>
<GridColumn Field=@nameof(steps.IsNext) HeaderText="Set Next" TextAlign="TextAlign.Left" Width="110">
<Template>
@{
var step = context as ProcessStepModel;
}
@if (step.IsNext)
{
<i>Current Position</i>
step.ReachedCurrentPosition = true;
}
@if (step.IsTransacted == 'Y' && step.ReachedCurrentPosition != true)
{
<SfButton OnClick="@(args => OpenDialog(step.Id))" IsToggle="true" IsPrimary="true">Move PCB to this step</SfButton>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(steps.ProcessName) HeaderText="Name" Width="110"></GridColumn>
<GridColumn Field=@nameof(steps.BenchName) HeaderText="Bench" Width="110"></GridColumn>
<GridColumn Field=@nameof(steps.IsTransacted) HeaderText="Transacted" Width="110"></GridColumn>
</GridColumns>
}