problem with passing parameters from listview when index changed

2 posts, 0 answers
  1. Hamza
    Hamza avatar
    24 posts
    Member since:
    Feb 2011

    Posted 30 Sep 2011 Link to this post

    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:

    how can I fix it ?
  2. Mira
    Mira avatar
    1124 posts

    Posted 05 Oct 2011 Link to this post

    Hello Hamza,

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

    I hope this helps.

    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
Back to Top