Ejemplo n.º 1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (provider != null)
     {
         IWindowsFormsEditorService editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
         if (editorService != null)
         {
             frmExternalRefvalEditor editor = new frmExternalRefvalEditor();
             if (editorService.ShowDialog(editor) == DialogResult.OK)
             {
                 return editor.SelectedValue;
             }
         }
     }
     return value;
 }
Ejemplo n.º 2
0
        private void dgvClientQuery_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            if (e.ColumnIndex == dgvClientQuery.Columns.IndexOf(ExternalRefVal))
            {
                frmExternalRefvalEditor form = new frmExternalRefvalEditor();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    dgvClientQuery[e.ColumnIndex, e.RowIndex].Value = form.SelectedValue;
                }

                e.Cancel = true;
            }
        }