Performance on dynamic data binding to radgrid

5 posts, 0 answers
  1. sangeetha
    sangeetha avatar
    2 posts
    Member since:
    Sep 2010

    Posted 22 Oct 2010 Link to this post

    Hi Team,

    I have to bind datas to radgrid where the number of columns are more which leads to very slow performance. Below is the code snippet that am using.
    string connString = ConfigurationManager.ConnectionStrings["AnswergenDB"].ConnectionString;
                SqlConnection sconn = new SqlConnection(connString);
                sconn.Open();
                SqlCommand sqlcmd = new SqlCommand("sp_Pivot", sconn);
                sqlcmd.CommandType = CommandType.StoredProcedure;            
                sqlcmd.Parameters.Add("@pivot", "column84");
                sqlcmd.Parameters.Add("@table", "Level_Zero");
                sqlcmd.Parameters.Add("@expr1", "SUM(Level_Zero.Column35)");
                sqlcmd.Parameters.Add("@expr2", "SUM(Level_Zero.Column52)");
                sqlcmd.Parameters.Add("@expr3", "SUM(Level_Zero.Column33)");
                sqlcmd.Parameters.Add("@exprcolumn1", "Payroll");
                sqlcmd.Parameters.Add("@exprcolumn2", "Total Billed");
                sqlcmd.Parameters.Add("@exprcolumn3", "Op Income");
                SqlDataReader pvtdr = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
                DataTable pvtdt = new DataTable();
                pvtdt.Load(pvtdr);
                string pvtqry = string.Empty;
                foreach (DataRow row in pvtdt.Rows)
                {
                    for (int i = 0; i < pvtdt.Columns.Count-1; i++)
                    {
                        pvtqry += row[i].ToString();
                    }                
                }
                pvtqry = pvtqry.Substring(0, pvtqry.Length - 1);
                pvtqry = "select column2, " + pvtqry + " from level_zero group by column2 order by column2";
                sconn.Open();
                sqlcmd = new SqlCommand(pvtqry, sconn);
                sqlcmd.CommandType = CommandType.Text;
                pvtdr = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
                DataTable pvttable = new DataTable();
                pvttable.Load(pvtdr);
                PivotGrid.DataSource = pvttable;
                PivotGrid.DataBind();

     

     

    The above query returns 1024 columns with 400 rows which takes about 6 to 7 minutes to bind the datas to radgrid. The query is getting executed in 8 secs, but binding it to the grid takes time. Since the query building is dynamic, there are possiblities to have more columns binded. Can some one suggest me in binding the records faster.

    Thanks in advance.
    Sangeetha

     

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Oct 2010 Link to this post

    Hello Sangeetha,

    Usually, limiting the number of rows/columns has the most impact on the performance. However, I suggest that you go through the following help link which elaborate on how to optimize RadGrid performance.
    Client/server grid performance optimizations

    Greetings,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. sangeetha
    sangeetha avatar
    2 posts
    Member since:
    Sep 2010

    Posted 22 Oct 2010 Link to this post

    Hi Pavlina,

    Thanks for your response. Limiting number of columns will not give me the solution. I have gone through about vertical scrolling with client binding that is applicable for rows in the grid. Do we have something similar to this for horizontal scrolling to affect the columns in the grid since columns are going to be dynamic in my scenario. Any help would be much appreciated.

    Thank you,
    Sangeetha
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 25 Oct 2010 Link to this post

    Hi Sangeetha,

    Another useful techniques for performance optimizations can be found here:
    http://www.telerik.com/products/aspnet-ajax/getting-started/top-performance.aspx
    http://www.telerik.com/support/aspnet-ajax.aspx (section "Performance")

    I hope you will find this information helpful. If any other questions arise please contact us back.

    Sincerely yours,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. BRK
    BRK avatar
    35 posts
    Member since:
    Jun 2012

    Posted 18 May 2011 Link to this post

    Hi Sangeetha,

    If you done with faster performance of Telerik Grid.Can you please explain me how  to do that.Very urgently needed.

    Thanking you,
    Bharath
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017