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

Get parent RadListBoxItem from child control inside item's template?

1 Answer 150 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
KN425000
Top achievements
Rank 1
KN425000 asked on 18 Jul 2011, 06:42 PM

Say I have a RadListBox, and inside the ItemTemplate for each item, I have two RadComboBox controls, a RadTextBox control, and a RadButton control.   I capture the button click in the RadButton's OnClientClicked event handler.

Inside the OnClientClicked event handler, I want to get a reference to the parent list item, so that I can I can delete that item.

For example:

function Button_OnClientClicked(button)
{
    var listBox = $find('MyListBox.ClientID');
    var itemContainingTheButtonThatWasClicked = /*  this is what I need to know    */
    listBox.get_items().remove(itemContainingTheButtonThatWasClicked);
}

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar Terziev
Telerik team
answered on 21 Jul 2011, 10:58 AM
Hi Kn425000,

We have already responded to your support ticket, as well as on this forum thread here.

Kind regards,
Dimitar Terziev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ListBox
Asked by
KN425000
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or