DataSource for RadPivotGrid

2 posts, 0 answers
  1. Sivakumar
    Sivakumar avatar
    10 posts
    Member since:
    Mar 2013

    Posted 29 Jul 2013 Link to this post


                i want  to assign the SQL table  as datasource for pivotgrid.

    My code:

    void RadPivotGrid1_NeedDataSource(object sender, PivotGridNeedDataSourceEventArgs e)
                (sender as RadPivotGrid).DataSource = GetDataTable();

      private DataTable GetDataTable()
                DataTable dt = new DataTable();
                using (SqlConnection conn = new SqlConnection("Data Source=zbserver01;initial Catalog=Sales;User Id=XXX;Password=XXX"))
                    using (SqlCommand cmd = new SqlCommand())
                        cmd.Connection = conn;
                        cmd.CommandText = "Select * from Car";
                        SqlDataAdapter adpt = new SqlDataAdapter(cmd);

                    return dt;


     its just show the empty grid,if  i am  do like this.

    Is it possible to assign a normal sql table as datasource for RadPivotGrid.

  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 01 Aug 2013 Link to this post


    Please ensure that you properly open the connection as shown in the online demo below:

    Maria Ilieva
    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.
Back to Top