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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how do i show selected toolstrip items based upon user selection...??

Thread ID:

Created:

Updated:

Platform:

Replies:

116898 Jun 26,2014 11:09 AM UTC Jun 30,2014 05:36 AM UTC WinForms 2
loading
Tags: RibbonControlAdv
Narry
Asked On June 26, 2014 11:09 AM UTC

i have toolstrip ex with "toolstripdropdownbuttons"... in that dropdown list i want to show some buttons 
 here is the code to loop for toolstrip items...
but how can i loop the dropdown list items....
i enclosed a snapshot of my design please check it once.....

foreach (ToolStripItem it in toolStripEx3.Items)
                {
                    for (int a = 0; a < BtnsList.Count; a++)
                    {
                        if (BtnsList[a].ToString() == it.Text.ToString())
                        {
                            it.Visible = true;
                        }
                    }
                }
Thanks in Advance....

Attachment: toolstripdropdown_bc8a83fe.zip

Saravanan T [Syncfusion]
Replied On June 27, 2014 01:31 PM UTC

Hi Narry,

 

Thank you for using syncfusion product,

 

We would like to let that your requirement can be achieved by using DropDownItems property in toolStripDropDownItem. Please make use of below code snippet.

 

Code Snippet [C#]:

foreach (ToolStripDropDownItem item in this.toolStripDropDownButton1.DropDownItems)

    {

        if (item.Text != string.Empty)

          {

            // do something

          }

    }

 

 

And additionally please make use below code snippet to retrieve selected DropDownItem.

 

Code Snoppet [C#]:

private void toolStripDropDownButton1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)

     {

        foreach (ToolStripDropDownItem td in toolStripDropDownButton1.DropDownItems)

          {

            if (td.Text.ToString() == e.ClickedItem.Text.ToString())

             {

                td.Visible = true;

             }

            else

             {

                td.Visible = false;

             }

          }           

       }

 

 

Please let us know whether if we have misunderstand your query, if so please provide some additional details regarding your requirement.

 

Please let us know if you need any further assistance,

 

Thanks & Regards,

T. Saravanan


Attachment: Ribboncontrol5_af02bb75.zip

Narry
Replied On June 30, 2014 05:36 AM UTC

thank you so much...

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;