DataSource for Pivot grid

2 posts, 0 answers
  1. Achuthan
    Achuthan avatar
    31 posts
    Member since:
    May 2007

    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 review the online demo below which demonstrates the proper approach for achieving the required functionality:

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top