We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Custom Buttons in Toolbar

Hi all,

i build a Custom button and add them to the toolbar. But the new buttom is alway on the first position in the toolbar. How can i put the new button at last position in toolbar?


Syncfusion.Web.UI.WebControls.Tools.ToolBarItem tbi = new Syncfusion.Web.UI.WebControls.Tools.ToolBarItem();

tbi.ButtonType = Syncfusion.Web.UI.WebControls.Tools.ToolBarControl.ToolBarButtonType.Regular;
tbi.Look = l_look;
tbi.Text = "Export values to Excel";
tbi.ClientOnItemSelect = l_JavaFunc;
tbi.ImagePath = l_ImagePath;
tbi.ToolTip = "Export values to Excel";
tbi.AppearanceMode = Syncfusion.Web.UI.WebControls.Tools.ToolBarControl.AppearanceMode.ImageOnly;

ToolBar.Items.Add(tbi);


Regards,
Stephan


5 Replies

YG Yavanaarasi G Syncfusion Team May 7, 2008 11:30 AM UTC

Hi Stephan,

Thank you for your interest in Syncfusion products.

I am not able to reproduce the issue that you mentioned here.I have created a simple sample with your code snippet for adding custom button in the toolbar. Here it adds the button at the last position. But you can set the position of the new button in the toolbar by using the insert method by specifying location. Please refer the below code snippet:


[C#]
Syncfusion.Web.UI.WebControls.Tools.ToolBarItem tbi = new Syncfusion.Web.UI.WebControls.Tools.ToolBarItem();
tbi.ButtonType = Syncfusion.Web.UI.WebControls.Tools.ToolBarControl.ToolBarButtonType.Regular;
tbi.Text = "Export values to Excel";
tbi.ImagePath = "Image/smile.bmp";
tbi.ToolTip = "Export values to Excel";
tbi.AppearanceMode = Syncfusion.Web.UI.WebControls.Tools.ToolBarControl.AppearanceMode.ImageOnly;
// this.ChartWebControl1.ToolBar.Items.Add(tbi);

//Set Position for the button:
this.ChartWebControl1.ToolBar.Items.Insert(4,tbi);


Here is the sample for your reference:
http://websamples.syncfusion.com/samples/Chart.Web/6.2.0.40/73411_ToolBar/main.htm

Please try this and let me know if this helps.

Regards,
G.Yavana




SD Steffen Dunst May 7, 2008 03:16 PM UTC

Hi again,
no way. I tried it with the foolowing lines of code.

Syncfusion.Web.UI.WebControls.Tools.ToolBarItem tbi = new Syncfusion.Web.UI.WebControls.Tools.ToolBarItem();
tbi.Text = "Export values to";
//ToolBar.Items.Insert(4, tbi);
ToolBar.Items.Add(tbi);

One difference is between our projects. I create the Webchart object at runtime. Maybe i must set some CSS properties or something like that for the toolbar?

Stephan



SD Steffen Dunst May 7, 2008 03:17 PM UTC

>Hi again,
no way. I tried it with the foolowing lines of code and it doesn't works correctly.

Syncfusion.Web.UI.WebControls.Tools.ToolBarItem tbi = new Syncfusion.Web.UI.WebControls.Tools.ToolBarItem();
tbi.Text = "Export values to";
//ToolBar.Items.Insert(4, tbi);
ToolBar.Items.Add(tbi);

One difference is between our projects. I create the Webchart object at runtime. Maybe i must set some CSS properties or something like that for the toolbar?

Stephan





YG Yavanaarasi G Syncfusion Team May 8, 2008 01:39 PM UTC

Hi Stephan,

We suspect the issue - 'Position of the ToolBar custom button is not changed while creating the chart dynamically' to be a defect and we have forwarded this to our development team for more analysis. We will update you in two business days with more details.

Thank you for your interest in Syncfusion Essential Studio.
Regards,
G.Yavana





BP Bhuvaneswari P Syncfusion Team May 12, 2008 06:31 AM UTC

Hi,

Thank you for your patience.

The issue with 'Position of the custom button in the toolbar is not changed while creating the chart dynamically.
'
has been confirmed as a defect and our Developers are working on fixing this issue. The fix for this issue is expected to be available on or before 6th June and we will get back to you on the specified date with more details.

Please refer to the following link for the status update on this defect fix.

http://www.syncfusion.com/support/issues/chart/Default.aspx?ToDo=view&questId=10254


Please let us know if you have any other concerns.

Regards,
Bhuvana


Loader.
Live Chat Icon For mobile
Up arrow icon