Exemplo n.º 1
0
        private void Users_GridView_ShowingEditor(object sender, CancelEventArgs e)
        {
            string col      = Users_GridView.FocusedColumn.FieldName;
            int    rowIndex = Users_GridView.FocusedRowHandle;
            var    selected = Users_GridView.GetFocusedRow().CastTo <Users>();
            bool   isNewRow = Users_GridView.IsNewItemRow(rowIndex);

            if (col == "UserID" && !(isNewRow || selected?.Status == ModifyMode.Insert))
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 2
0
        private void FilterUserRole()
        {
            this.UserRole_GridView.ClearColumnsFilter();

            string filter = string.Empty;
            Users  user   = Users_GridView.GetFocusedRow().CastTo <Users>();

            if (user != null)
            {
                UserID_TextBox.Text = user.UserID;
                UserID_CheckedComboBoxEdit.EditValue = new List <string> {
                    user.UserID
                };
                UserID_CheckedComboBoxEdit.RefreshEditValue();
                filter += $"[UserID] = '{user.UserID}'";
            }

            // filter grid
            if (!string.IsNullOrEmpty(filter))
            {
                this.UserRole_GridView.ActiveFilterString = filter;
            }
        }