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

Rad Grid Performance - Rendering too slow

1 Answer 1060 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ankit
Top achievements
Rank 1
Ankit asked on 19 Dec 2012, 12:18 PM
We're using RadGrid(with paging enabled) in a SharePoint site.
Our problem is that Grid takes too much time to load in the browser(7-8 seconds). I verified, that data fetching part is able to provide data to Grid within 1-2 seconds.

Here, We are not using the default template columns provided in RadGrid. 
We've created custom item templates(implementing the ITemplate interface) to create columns. e.g. to create a hyperlink column, We're using below template:
public class HyperlinkItemTemplate<TProperty, T> : ITemplate
    {
        public string PropertyName { get; set; }
        public string PropertyKey { get; set; }
        public string NavigateUrl { get; set; }
 
        public HyperlinkItemTemplate(string propertyName, string propertyKey, string navigateUrl)
        {
            PropertyName = propertyName;
            PropertyKey = propertyKey;
            NavigateUrl = navigateUrl;
        }
 
        public void InstantiateIn(Control c)
        {
            HyperLink hyperLink = new HyperLink();
            hyperLink.DataBinding += OnDisplayDataBinding;
            c.Controls.Add(hyperLink);
        }
 
        private void OnDisplayDataBinding(object sender, EventArgs e)
        {
            HyperLink hyperLink = (HyperLink) sender;
            hyperLink.Text = TemplateHelper.GetValue<String, T>((GridDataItem) hyperLink.NamingContainer, PropertyName);
            hyperLink.NavigateUrl = String.Format(NavigateUrl, TemplateHelper.GetValue<TProperty, T>((GridDataItem)hyperLink.NamingContainer, PropertyKey));
        }
    }
When we tried a RadGrid(with AutoGenerateColumns property set to true) with same amount of data set, it was much faster(almost 50% fast).
Is there any performance issue with RadGrid when using custom item templates?
Any suggestions, to improve the performance.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Dec 2012, 09:36 AM
Hello,

I recommend that you examine the article below for useful tips about how to optimize RadGrid performance: 
http://www.telerik.com/help/aspnet-ajax/grid-viewstate-reduction-techniques.html

Greetings,
Pavlina
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Ankit
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or