0

I have a legacy app that uses Infragistics UltraWebGrid and am running into a particularly infuriating issue.

In runtime a column is added with checkboxes. When users hits save, it adds all users that are checked to a db. I have to add code to validate if a checked user is in fact active before allowing the save. I set up my test data where the first one checked in inactive and the second one checked is fine. However, when I debug my code, it SOMETIMES sees that cell.Selected is true, but usually does not (2/10 times). It ALWAYS sees that the 2nd one's cell.Selected is true.

This leads me to believe that UltraWebGrid does some sort of lazy eval and doesn't update the table from the UI thread right away.... what's going on here?

EDIT

Just realized I've been using the cell.Selected property this whole time, which is not equal to Checked... not sure how to get the Checked value out though...

foreach (UltraGridRow row in uwgRoster.Rows)
{
    foreach (UltraGridCell cell in row.Cells)
    {
        if (cell.Column.Type == ColumnType.CheckBox && cell.Key.ToLower().Contains("service") && cell.Selected)
        {
            var casefileId = row.Cells.FromKey("CasefileID").Value.ToString();
            var casefile = new Casefile(Convert.ToInt32(casefileId), false);

            if (!casefile.ActiveFlag)
            {
                inactives.AppendLine("- " + row.Cells.FromKey("Name").ToString());
            }
        }
    }
}
4

0 回答 0