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

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

2 Replies

ST Saravanan T Syncfusion Team 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


NA Narry June 30, 2014 05:36 AM UTC

thank you so much...

Loader.
Up arrow icon