Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
510
Identifying data on checkbox selection
posted

Hi,

I am using ultrawebgrid in my project and I've a Checkbox template column. Once the user selects checkboxes, I've code to identify all the rows selected and then read certain column values for those selected rows. Here is the code snippet of the same:

***

private void GetSelectedFunds(UltraWebGrid uwg)
    {
        Boolean boolGroupSelectedFound = false;
        reportingperiodownerships = new List<ReportingPeriodOwnership>();
        string sFundNbr;

        foreach (UltraGridRow oRow in uwg.Rows)
        {
            if (boolGroupSelectedFound)
                break;
            if (oRow.HasChildRows)
            {
                foreach (UltraGridRow row in oRow.Rows)
                {
                  
                    if (!row.Cells[3].Value.Equals(0))//look for the "select" checkbox fields
                    {
                        boolGroupSelectedFound = true;
                        ReportingPeriodOwnership rpo = new ReportingPeriodOwnership();
                        rpo.InternalID = int.Parse(SelectedUserInternalIdHiddenField.Value.Trim());
                        rpo.ReportingPeriodID = (int)row.Cells[1].Value;
                        sFundNbr = (string)row.Cells[5].Value;
                        reportingperiodownerships.Add(rpo);
                    }
                }
            }
        }
    }
***

The grid is being grouped by a column (Role). The code works fine when the grid is not sorted. But, when the user sorts the grid, the column values that I am reading [ReportingPerioID and sFundNbr] are the ones that are actual values in the checkbox selected rows. Looks like the actual place holder of the rows is changing.

can anyone help me with this?

Thanks,

Kala