Forced to select checkbox rows creating unacceptable interface

2 posts, 0 answers
  1. George
    George avatar
    105 posts
    Member since:
    Oct 2014

    Posted 17 Jan 2017 Link to this post

    I have a radgrid with GridClientSelectColumn (checkbox) column.  It seems I cannot set the checkboxes from the data using a DataTable.  So I am forced to set the checkboxes in my asp in a second data pass.   The grid is being used to select rows, the checks are the data, the user has picked rows and is trying to update them in this application scenario.

    protected void MemberGrid_PreRender(object sender, EventArgs e)
    {
        // For Checking CheckBox Column for time first time on Pageload
        if (!IsPostBack && mode == Team.Modes.Edit) {
            foreach (GridDataItem item in MemberGrid.MasterTableView.Items) {
                string memberStr = item[TeamData.MEMBER_ID].Text;
                if (team.HasMember(int.Parse(memberStr))) {
                    CheckBox cb = (CheckBox)item[TeamData.TEAM_SELECT].Controls[0];
                    cb.Checked = true;
                    item.Selected = true;
                }
            }
        }
    }

     

    This works, but the problem is I must select the row (statement: item.Selected = true;). Only setting the Checked to true will not check the checkbox - I consider this a bug.  Forcing the Selected state means that if you click on the grid, the selection is removed along with every check. I consider this an unacceptable interface for my users.  Losing all your checked boxes so simply is bad. Additionally, checking a box does not remove the select from the rows - in fact, I cannot figure out a way to unselect without removing all the checks.  All this has forced me to put this note on my web page above the grid.

    Important tip, hold the Ctrl key down while selecting rows to avoid unselecting other rows.

    I do not know how this will impact tablet users that do not have a Ctrl key.  I suspect editing your checked rows will not be possible. Changing a filter or sorting by column removes the selection along with all the checks (that is, it remove the user's data).

    This forum post discusses checking boxes and stops at needing to select the row after the check only does not work. 

    George

  2. George
    George avatar
    105 posts
    Member since:
    Oct 2014

    Posted 17 Jan 2017 Link to this post

    Discovered a property the fixes the problem.  

    adminGrid.ClientSettings.Selecting.UseClientSelectColumnOnly = true;

    This forces the user to click the checkbox, which is acceptable considering the alternative.

     

Back to Top