Veena Ramachandran Posted December 8, 2009 Report Share Posted December 8, 2009 Hi, I have added a custom command in the chartfx toolbar and I want to call some server side code on the click of that custom command.I have tried triggering UserCommand Event.But it is not working. The code I am using to trigger the event is given below protected void chartFxReport_UserCommand(object sender, CommandUIEventArgs e){ if (e.CommandId == MyCustomCommandId){chartFxReport.BackColor = System.Drawing. Color.Red;} } In the below code I am adding custom command to the toolbar. private void AddUserCommand() { Command command = new Command(MyCustomCommandId); System.Drawing.Bitmap buttonImage = new System.Drawing.Bitmap(ImagePath);int imageIndex = chartFxReport.Commands.AppendImage(buttonImage); command.ImageIndex = imageIndex;command.Enabled = true; chartFxReport.Commands.Add(command);command.GeneratePostBack = true; chartFxReport.ToolBar.Insert(0, new ToolBarItem(MyCustomCommandId));chartFxReport.UserCommand += new CommandUIEventHandler(chartFxReport_UserCommand); } Is there any other way to trigger the UserCommand Event ? Thanks in advance. Veena Quote Link to comment Share on other sites More sharing options...
Frank Posted December 8, 2009 Report Share Posted December 8, 2009 Are you generating an image or a .NET Client control? Quote Link to comment Share on other sites More sharing options...
Veena Ramachandran Posted December 9, 2009 Author Report Share Posted December 9, 2009 Thanks for your response. The render format using is .NET. I have tried to trigger the event using javascript. It worked for me. Thanks. Veena. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.