This is a migrated thread and some comments may be shown as answers.

Performance on dynamic data binding to radgrid

4 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sangeetha
Top achievements
Rank 1
sangeetha asked on 22 Oct 2010, 09:08 AM
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

 

 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Oct 2010, 02:34 PM
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
0
sangeetha
Top achievements
Rank 1
answered on 22 Oct 2010, 03:41 PM
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
0
Pavlina
Telerik team
answered on 25 Oct 2010, 11:04 AM
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
0
BRK
Top achievements
Rank 1
answered on 18 May 2011, 06:01 AM
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
Tags
Grid
Asked by
sangeetha
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
sangeetha
Top achievements
Rank 1
BRK
Top achievements
Rank 1
Share this question
or