Ejemplo n.º 1
0
        private void PropertyGridControl_CustomRecordCellEdit(object sender, GetCustomRowCellEditEventArgs e)
        {
            var rowType = e.Row.Properties.RowType;

            if (rowType == typeof(bool?))
            {
                e.RepositoryItem = editorCheck;
            }
            else if (rowType == typeof(Color?))
            {
                e.RepositoryItem = editorColor;
            }
            else if (rowType == typeof(DateTime?))
            {
                e.RepositoryItem = editorDate;
            }
            else if (rowType == typeof(int?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(long?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(byte?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(short?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(decimal?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(float?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(double?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(ushort?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(uint?))
            {
                e.RepositoryItem = editorCalc;
            }
            else if (rowType == typeof(ulong?))
            {
                e.RepositoryItem = editorCalc;
            }
        }
Ejemplo n.º 2
0
        private void OnCustomRecordCellEdit(object sender, GetCustomRowCellEditEventArgs e)
        {
            PropertyGridControl control = (PropertyGridControl)sender;

            MemberInfo[] mi = control.SelectedObject.GetType().GetMember(e.Row.Properties.FieldName);
            PasswordPropertyTextAttribute attr = (PasswordPropertyTextAttribute)Attribute.GetCustomAttribute(mi[0], typeof(PasswordPropertyTextAttribute));

            if (attr != null && attr.Password)
            {
                e.RepositoryItem = passwordEdit;
            }
        }
Ejemplo n.º 3
0
 private void pgcProps_CustomRecordCellEdit(object sender, GetCustomRowCellEditEventArgs e)
 {
     int recordIndex = e.RecordIndex;
     if (e.Row.Properties.RowType == typeof(bool?))
     {
         e.RepositoryItem = this.riComboBox;
     }
 }