コード例 #1
0
ファイル: pickEquipment.aspx.cs プロジェクト: zxl881203/src
    protected void setChecked(int recordId)
    {
        DataTable dataTable = ConferenceManage.QueryApplyEquipment(recordId);

        if (dataTable.Rows.Count > 0)
        {
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                int num = (int)dataTable.Rows[i]["EquipmentIRecordID"];
                foreach (GridViewRow gridViewRow in this.gvEquipment.Rows)
                {
                    CheckBox checkBox = (CheckBox)gridViewRow.Cells[0].FindControl("cbSel");
                    int      num2     = (int)this.gvEquipment.DataKeys[gridViewRow.RowIndex]["RecordID"];
                    if (num2 == num)
                    {
                        checkBox.Checked = true;
                    }
                    else
                    {
                        checkBox.Checked = false;
                    }
                }
            }
        }
    }