This is a migrated thread and some comments may be shown as answers.

GridClientSelectColumn programtic selection from database

1 Answer 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 19 Sep 2008, 06:51 PM
I am creating a timesheet application and need to be able to associate users to assignments.  I am currently using a grid to display all users in the organization, with a GridClientSelectColumn accompanying each user.  The administrator of the system would select the checkbox next to a users name to let the system know that the selected user can log time to that assignment.  The problem that I am encountering is that I see no way to populate the checkboxes of the users that are already associated with the assignment. 

The other option that I have explored is to use a GridBoundColumn with a template employing a checkbox in the item template.  This option does not work for me because it requires three clicks to select each user:  First click = Edit, Second click = check the associate checkbox, Third click = Accept.  This is extremely inefficient when there are several users that need to be associated with each assignment.

Any suggestions would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Sep 2008, 11:07 AM
Hello Nathan,

I'm not sure of your requirement but from my understanding, I suppose you want to select rows for a set of users. If so, check out the following code.
cs:
  protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridDataItem dataitem in RadGrid1.Items) 
        {         
            if (dataitem["bool"].Text == "True") 
            { 
                dataitem.Selected = true
            }             
        } 
    } 

Princy.
Tags
Grid
Asked by
Nathan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or