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

problem with passing parameters from listview when index changed

1 Answer 41 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Hamza
Top achievements
Rank 1
Hamza asked on 30 Sep 2011, 12:17 PM
hi all :)

I have a list view, and I want to set some parameters to some controls

i have this function

void RadListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Literal1.Text = YouTubeScript.Get(RadListView1.SelectedItems[0].GetDataKeyValue("Video_Path").ToString(), auto, _W, _H);
        Label1.Text = RadListView1.SelectedItems[0].GetDataKeyValue("Video_Path").ToString();
    }


and when I write this line at page_load, I got his error:

http://msasoftware.net//Hamza/Pics/Programmingproblems/problem874564.png


how can I fix it ?

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 05 Oct 2011, 08:05 AM
Hello Hamza,

Please use the following code for attaching the event handler:
RadListView1.SelectedIndexChanged += new EventHandler<EventArgs>(RadListView1_SelectedIndexChanged);

I hope this helps.

Greetings,
Mira
the Telerik team
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 their blog feed now
Tags
ListView
Asked by
Hamza
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or