RadListView Created and Binding from Code Behind

2 posts, 0 answers
  1. Susi
    Susi avatar
    40 posts
    Member since:
    Jul 2012

    Posted 14 Nov 2012 Link to this post

    Dear ALL,

    How to create and bind RadListView from code behind like Pege_load event and  all my data's are available in DataTable.how to bind and implement fully by code behind page..

    Thanks,
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Nov 2012 Link to this post

    Hi,

    Try the following code to bind listview from code behind.
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadListView listview = new RadListView();
        form1.Controls.Add(lv1);
        SqlConnection con1 = new SqlConnection(WebConfigurationManager.ConnectionStrings["NorthwindConnectionString3"].ConnectionString);
        SqlCommand cmd = new SqlCommand("SELECT top 5 * FROM [Employees]", con1);
        SqlDataAdapter ad = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        ad.Fill(ds);
        listview.DataSource = ds;
        listview.DataBind();
    }

    Also check this documentation and demo for more.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top