This is a migrated thread and some comments may be shown as answers.

CommandBindings are reset after Build

6 Answers 102 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Deepak Rao
Top achievements
Rank 1
Deepak Rao asked on 27 Jan 2010, 04:33 PM
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

6 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 29 Jan 2010, 08:39 AM
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.
0
Deepak Rao
Top achievements
Rank 1
answered on 29 Jan 2010, 09:28 AM
Hi Dobry,
  That worked. Thanks
0
Roberto
Top achievements
Rank 1
answered on 09 Feb 2010, 04:46 PM
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
0
Dobry Zranchev
Telerik team
answered on 12 Feb 2010, 08:31 AM
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.
0
Roberto
Top achievements
Rank 1
answered on 17 Feb 2010, 09:28 PM
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
0
Dobry Zranchev
Telerik team
answered on 19 Feb 2010, 02:11 PM
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.
Tags
Menu
Asked by
Deepak Rao
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Deepak Rao
Top achievements
Rank 1
Roberto
Top achievements
Rank 1
Share this question
or