Jump to content
Software FX Community

UserCommand Event not firing


Veena Ramachandran

Recommended Posts

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 

 

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...