Disable or change KeyPress in MessageBoxButtonsConfig

  1. #1

    Disable or change KeyPress in MessageBoxButtonsConfig

    Hi,

    By default the button "Yes" is executed by pressing ENTER.
    Changing to the "Cancel" button is executed by pressing ENTER.

    Or disable all keypress in messageboxconfig.

    Thankss!!


    <ext:Button runat="server" ID="btnRegistrarGestao" Text="Registrar gesto" Icon="DoorIn"
                                                            AutoWidth="True" StandOut="true" StyleSpec="margin-right: 10px;">
                                                            <DirectEvents>
                                                                <Click ViewStateMode="Enabled" OnEvent="btnRegistrarGestao_Click">
                                                                    <EventMask ShowMask="true" />
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>



    protected void btnAceitarDefesaPrevia_Click(object sender, DirectEventArgs e)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Salvar Alteraces?",
                    Message = string.Format(@"Tem certeza que deseja aceitar a defesa prvia do contribuinte {0} ?", NotifFiscalAtual.NomeContribuinte.ToString()),
                    Buttons = MessageBox.Button.YESNOCANCEL,
                    Icon = MessageBox.Icon.QUESTION,
                    AnimEl = this.btnRegistrarGestao.ClientID,
                    MessageBoxButtonsConfig = new MessageBoxButtonsConfig
                    {
                        //Alterao do texto dos botes em vitude do controle no permitir a re-ordenao destes.
                        //Preveno para que o usurio ao clicar "enter" no prossiga a operao sem confirmao.
                        Yes = new MessageBoxButtonConfig
                        {
                            Text = "Yes",
                            Handler = "Ext.net.DirectMethods.ExecutarAcoesBotoesDadosContribuintes('AceitarDefesa')"
                        },
                        
                        No = new MessageBoxButtonConfig
                        {
                            Text = "No",
                        },
                        
                        Cancel = new MessageBoxButtonConfig
                        {
                            Text = "Cancelar"
                        }
                    }
                });
            }
  2. #2
    Hi,

    Welcome to Ext.NET!

    Changing to the "Cancel" button is executed by pressing ENTER.
    What about the standard way using Tab?

    Or disable all keypress in messageboxconfig.
    I could help with that if it's still actual.

Similar Threads

  1. Replies: 2
    Last Post: Jul 11, 2012, 5:18 PM
  2. KeyPress on GridPanel
    By Dominik in forum 1.x Help
    Replies: 1
    Last Post: Feb 13, 2012, 2:33 PM
  3. MessageBoxButtonsConfig
    By walle in forum 1.x Help
    Replies: 6
    Last Post: Aug 01, 2011, 11:49 AM
  4. [CLOSED] don't works KeyPress
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 19, 2011, 9:29 AM
  5. [CLOSED] keypress event
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 18, 2011, 3:53 PM

Tags for this Thread

Posting Permissions