This is a migrated thread and some comments may be shown as answers.

How to remove RadToolBarDropDown itmes programmaticaly

1 Answer 55 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
splattne
Top achievements
Rank 2
splattne asked on 25 Aug 2008, 11:25 AM
Hi,

How can I programmatically remove a RadToolBarButton item (server side)?

I know there's Toolbar.Items.Remove(...)

But I can neither use the Value property nor the CommandName on a Dropdown in order to get a reference to the object to pass to the Remove method. There is no ID on the items either.

I can't / won't use ByText, because it's a multilingual system and I don't want to depend on such a criterion.

Do I have to use attributes or is there a smarter way?

Thanks,
Stefan

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 27 Aug 2008, 08:21 AM
Hi splattne,

You can use the RemoveAt method passing the index of the dropdown button to it:

RadToolBar1.Items.RemoveAt(3);

where 3 is the index of my dropdown.

Best wishes,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolBar
Asked by
splattne
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Share this question
or