4 Answers, 1 is accepted
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Jan 2011, 12:21 PM
Hello,
There are two ways for this. If you are binding to a datasource then you can use
or, when adding items, you can subscribe to the ItemsChanged event
Hope that helps
Richard
There are two ways for this. If you are binding to a datasource then you can use
AddHandler
Me
.RadListControl1.ItemDataBound,
AddressOf
RadListControl_ItemDataBound
Private
Sub
RadListControl_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
ListItemDataBoundEventArgs)
MessageBox.Show(e.NewItem.Text)
End
Sub
or, when adding items, you can subscribe to the ItemsChanged event
AddHandler
Me
.RadListControl1.ListElement.ItemsChanged,
AddressOf
RadListControl_ItemsChanged
Private
Sub
RadListControl_ItemsChanged(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.WinControls.Data.NotifyCollectionChangedEventArgs)
MessageBox.Show(
CType
(e.NewItems(0), RadListDataItem).Text)
End
Sub
Hope that helps
Richard
0
Eric
Top achievements
Rank 1
answered on 06 Jul 2012, 02:50 PM
Hi!
I just have a tiny question for this:
Do I have to add the handler manually at the code for the RadListControl_ItemsChanged Event?
The ItemDataBound I can find at the NavigationBar, but not the ItemsChanged (Maybe because it's from the ListElement Property)
Is that right?
Thanks in advance,
Eric
I just have a tiny question for this:
Do I have to add the handler manually at the code for the RadListControl_ItemsChanged Event?
The ItemDataBound I can find at the NavigationBar, but not the ItemsChanged (Maybe because it's from the ListElement Property)
Is that right?
Thanks in advance,
Eric
0
Eric
Top achievements
Rank 1
answered on 06 Jul 2012, 03:03 PM
Also, this event, the ItemsChanged, has being triggered unstoppable until I get a stack overflow. Is this the right event to catch the add of an ListItem in the list? (In this particular case I'm not working with a Data Binding).
Thanks,
Eric
Thanks,
Eric
0
Hello Tran,
Thank you for writing.
Indeed the event belongs to the ListElement and you have to manually subscribe to it.
Yes, this is the right event to capture changes in an item. The event arguments allow you to check what is the action that triggered the event.
I hope this information addresses your question. If there is anything else I can assist you with, do not hesitate to contact me.
Regards,
Stefan
the Telerik team
Thank you for writing.
Indeed the event belongs to the ListElement and you have to manually subscribe to it.
Yes, this is the right event to capture changes in an item. The event arguments allow you to check what is the action that triggered the event.
I hope this information addresses your question. If there is anything else I can assist you with, do not hesitate to contact me.
Regards,
Stefan
the Telerik team