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:
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.
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));
}
}
Is there any performance issue with RadGrid when using custom item templates?
Any suggestions, to improve the performance.
Thanks in advance.