CommandBindings are reset after Build

7 posts, 0 answers
  1. Deepak Rao
    Deepak Rao avatar
    7 posts
    Member since:
    Jan 2010

    Posted 27 Jan 2010 Link to this post

    Hi,
     I have a RADMenuItem for Refresh with a command binding for Action command set for CTRL + F5 using the designer. When I build the application, the command binding gets reset to default which is nothing...
    What should I be doing?

    Thanks
    Deepak
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 29 Jan 2010 Link to this post

    Hi Deepak Rao,

    We know about this issue and it will be resolved as fast as possible. In the mean time, you can
    set this command binding:

    InputBinding inputBinding = new Telerik.WinControls.Keyboard.InputBinding();
    inputBinding.Chord = new Chord(new List<Keys>(new Keys[] { Keys.F5 }), new ChordModifier(Keys.Control));
    inputBinding.Command = new Telerik.WinControls.Elements.ClickCommand();
    inputBinding.CommandContext = this.radMenuItem2;
    this.radMenu1.CommandBindings.Add(inputBinding);

    If you have additional questions, feel free to ask.

    Regards,
    Dobry
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Deepak Rao
    Deepak Rao avatar
    7 posts
    Member since:
    Jan 2010

    Posted 29 Jan 2010 Link to this post

    Hi Dobry,
      That worked. Thanks
  5. Roberto
    Roberto avatar
    4 posts
    Member since:
    Mar 2008

    Posted 09 Feb 2010 Link to this post

    Hello,
    I'm trying with radRibbonBar in MDI form for calling a child form, but it works only the first time. If I close the child form, the CommandBinding doesn't work. However, if I open the child form, the CommandBinding works again.
    Here is the code I'm using:

                InputBinding binding = new InputBinding();
                binding.Chord = new Chord(new List<Keys>(new Keys[] { Keys.P }), new ChordModifier(Keys.Control));

                // assign the CommandBase descendant object
                binding.Command = new Telerik.WinControls.Elements.ClickCommand();
                // the object context for the command
                binding.CommandContext = this.rbeProcesar;
                
                // add binding to command binding(s)
                this.radRibbonBar1.CommandBindings.Add(binding);

    Best Regards,
    Roberto
  6. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 12 Feb 2010 Link to this post

    Hi Roberto,

    We cannot reproduce your issue. Please look at the attached example. If you do not find a solution there, you can send us your example. Feel free to ask if you have any additional questions as well.

    Regards,
    Dobry Zranchev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. Roberto
    Roberto avatar
    4 posts
    Member since:
    Mar 2008

    Posted 17 Feb 2010 Link to this post

    Hello,
    It's the proyect example. If I load a simple windows form as child, the command works fine. But, I add a radTextBox to the child form, the command only works for the first time, if I close the child form the command doesn't work.
    public partial class Form9 : Form 
        { 
            public Form9() 
            { 
                InitializeComponent(); 
     
                InputBinding binding = new InputBinding(); 
                binding.Chord = new Chord(new List<Keys>(new Keys[] { Keys.P }), new ChordModifier(Keys.Control)); 
     
                // assign the CommandBase descendant object 
                binding.Command = new Telerik.WinControls.Elements.ClickCommand(); 
                 
                // the object context for the command 
                binding.CommandContext = this.radButtonElement1; 
     
                // add binding to command binding(s) 
                this.radRibbonBar1.CommandBindings.Add(binding); 
            } 
     
            private void radButtonElement1_Click(object sender, EventArgs e) 
            { 
                MessageBox.Show("test"); 
                LoadChildForm(); 
            } 
     
            private void radButtonElement2_Click(object sender, EventArgs e) 
            { 
                Form frm = new Form(); 
                frm.MdiParent = this
                frm.Show(); 
     
            } 
     
            private void LoadChildForm() 
            { 
                Form10 frm = new Form10(); 
                frm.MdiParent = this
                frm.Show(); 
            } 
        } 

    My SO is Vista Business.

    Regards,
    Roberto
  8. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 19 Feb 2010 Link to this post

    Hi Roberto,

    Thank you for your positive feedback.

    We succeeded to reproduce this issue. It will be resolved in our future releases. We are sorry for the inconvenience.

    Sincerely yours,
    Dobry Zranchev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WinForms is Visual Studio 2017 Ready