I am trying to sort all the updated item in DataTableA, by coloring the item that has not been completely updated, and removing the item that has been updated completely from the DataTable. both The item that has been updated completely and the incomplete updated item are in "managed" table in the database, the discharge date will be null if it has not been completely updated.

Below code works but it can take all day for the page to run. This is C# webform.

The code below is writing on my code behind file:

```
 foreach (GridDataItem dataItem in RadGrid1.Items)
  {
    var panu = dataItem["Inumber"];
    var panum = panu.Text;
    var _cas = db.managed.Any(b =>
        b.panumber == panum && b.dischargedate != null);                
    var casm = db.managed.Any(b => 
        b.panumber == panum && b.dischargedate == null);
   if (_cas == true)
     {
        dataItem.Visible = false;

      }
   if (casm == true)
     {
        dataItem.BackColor = Color.Yellow;
     }

 }

```