I have a Data Grid that currently displays information.
I have a column named "Status" that displays P, C, or I
I have a Rebind occurring every 15 seconds
After each rebind, or during (not sure) I want to check each row for
the value "P". If that column Status is P, i want to count it and add it
to a variable.
Once the count is complete after the grid loads, I want to fire off some
script based on the results.
So if there are any values of P in the grid results, I want do something.
How can I accomplish this? Below is what I started to do, but its not
working right.
Again, trying to loop through EVERY ROW, get the calculated value based
on what the Status is. If there are no statuses processing, then I will
return a 0 and do something.
What's the best way of doing this?
I have a column named "Status" that displays P, C, or I
I have a Rebind occurring every 15 seconds
After each rebind, or during (not sure) I want to check each row for
the value "P". If that column Status is P, i want to count it and add it
to a variable.
Once the count is complete after the grid loads, I want to fire off some
script based on the results.
So if there are any values of P in the grid results, I want do something.
How can I accomplish this? Below is what I started to do, but its not
working right.
Again, trying to loop through EVERY ROW, get the calculated value based
on what the Status is. If there are no statuses processing, then I will
return a 0 and do something.
What's the best way of doing this?
protected void grdData_ItemDataBound(object sender, GridItemEventArgs e)
{
for (int i = 0; i < grdData.MasterTableView.Items.Count; i++)
{
string status = item["Status"].Text;
if (status == Constants.RunStatusCodes.PROCESSING)
{
processingModels = processingModels + 1;
}
}
if (processingModels == 0)
{
txtActive.Text = "N";
updPanel.Update();
}