예제 #1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            this.dgvInfo.AutoGenerateColumns = false;
            if (this.DTUser.Columns.Count > 0)
            {
                this.DTUser.DefaultView.Sort = PiUserTable.FieldSortCode;
            }

            this.dgvInfo.DataSource = this.DTUser.DefaultView;
            if (this.CurrentEntityId.Length > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = BasePageLogic.GetRowIndex(this.DTUser, PiUserTable.FieldId, this.CurrentEntityId);
            }
            this.SetControlState();
        }
예제 #2
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            this.dgvInfo.AutoGenerateColumns = false;
            if (this.DTUser.Columns.Count > 0)
            {
                this.DTUser.DefaultView.Sort = PiUserTable.FieldSortCode;
            }

            this.dgvInfo.DataSource = this.DTUser.DefaultView;
            if (this.CurrentEntityId.Length > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = BasePageLogic.GetRowIndex(this.DTUser, PiUserTable.FieldId, this.CurrentEntityId);
            }
            // 设置排序按钮
            this.ucSortControl.DataBind(this.dgvInfo, this.permissionEdit);
            // 设置用户能否修改有效状态
            if (!this.permissionEdit)
            {
                // 只读属性设置
                this.dgvInfo.Columns["colEnabled"].ReadOnly = !this.permissionEdit;
            }
            this.SetControlState();
        }