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

Is it neccessary to rebind the Telerik ListView whenever its SelectedIndexChangedEvent is fired ?

1 Answer 40 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Harendra
Top achievements
Rank 1
Harendra asked on 10 Oct 2013, 10:58 AM
Hi,
I have an unusual question regarding listview. I have used many controls like drop down , gridview etc but didn't find anything like to rebind the control whenever its selectedindexchanged event is fired?

But today when i was working with the Listview of which i was firing its SelectedIndexChanged event on item selection, what i noticed that the event runs successfully for the first time and details of the item selected is shown but as soon as some other item is selected, the event throws an error on the code where it accepts the item value - as shown below

ArgumentOutOfRangeException :
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Exception is thrown when : 

ItemID = ItemListView.SelectedValue.ToString();


 I Though of rebinding it in the event itself and the problem went away.
I am still confused that why i should rebind listview in the SelectedIndexChanged event.

Thanks for reading and any usefull info will be appreciated ..!!

1 Answer, 1 is accepted

Sort by
0
Accepted
Kostadin
Telerik team
answered on 15 Oct 2013, 07:45 AM
Hello Harendra,

A colleague of mine has already answered your other forum thread. I would ask you to continue your conversation with him there and close this one.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ListView
Asked by
Harendra
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or