Hi,
I have created the dash board page, using telerik charts
Telerik version : RadControls for ASPNET AJAX Q1 2008
and visual studio 2008 / sqlserver.
I have 10 user controls having charts.
In the dash board page I am creating the zones and dock controls runtime and inside dock
control, binding the user controls.
Now when i moved to the dash board page it calls all the 10 stored proc to bind the charts
which is in usercontrol one by one and display the dashboard page simultaneously.
What i want is to call all the 10 stored proc simultaneously and display that one by one as
loaded.
Like igogle they load the dashboard page and uses the loading image to the items which takes
time to load.
can any body help me.
7 Answers, 1 is accepted
I am creatiing the zones and docks at runtime through database
the code is below
public void BuildTab()
{
try
{
hvCurrentTabName.Value = RadTabStrip1.SelectedTab.Text.ToString();
DataSet ds = new DataSet();
DataAccess objDataAccess = new DataAccess();
ds = objDataAccess.proc_dashGet_Zones_User(RadTabStrip1.SelectedTab.Text.ToString(), UserID);
int ZonCount = ds.Tables[0].Rows.Count;
for (int i = 0; i < ZonCount; i++)
{
RadDockZone NewRadZone = new RadDockZone();
NewRadZone.EnableViewState =
true;
NewRadZone.ID = ds.Tables[0].Rows[i][
"AccountUserZoneId"].ToString() + "_Zone";
string strZoneType = ds.Tables[0].Rows[i]["ZoneType"].ToString();
if (strZoneType == "V")
{
NewRadZone.Orientation =
Orientation.Vertical;
int ZminH = Convert.ToInt32(ds.Tables[0].Rows[i]["VerticalZoneMinHeight"].ToString());
NewRadZone.MinHeight = ZminH;
int ZWidth = Convert.ToInt32(ds.Tables[0].Rows[i]["VerticalZoneWidth"].ToString());
NewRadZone.Width = ZWidth;
}
else
{
NewRadZone.Orientation =
Orientation.Horizontal;
int ZHeight = Convert.ToInt32(ds.Tables[0].Rows[i]["HorizontalZoneHeight"].ToString());
NewRadZone.MinHeight = ZHeight;
int ZMinWidth = Convert.ToInt32(ds.Tables[0].Rows[i]["HorizontalZoneMinWidth"].ToString());
NewRadZone.Width = ZMinWidth;
}
NewRadZone.FitDocks =
true;
NewRadZone.Style.Add(
"float", "left");
NewRadZone.Style.Add(
"margin-right", "0px");
NewRadZone.BorderWidth = 0;
NewRadZone.BackColor = System.Drawing.
Color.White;
int AccountUserZoneId = Convert.ToInt32(ds.Tables[0].Rows[i]["AccountUserZoneId"].ToString());
DataSet dsZone = new DataSet();
dsZone = objDataAccess.proc_dashGet_DashboardDetails_User(AccountUserZoneId);
int DockCount = dsZone.Tables[0].Rows.Count;
for (int j = 0; j < DockCount; j++)
{
RadDock NewRadDock = new RadDock();
NewRadDock.EnableViewState =
true;
NewRadDock.ID = dsZone.Tables[0].Rows[j][
"DashboardItemId"].ToString() + "_" + dsZone.Tables[0].Rows[j]["AccountUserDashboardSettingId"].ToString() + "_Dock";
NewRadDock.Title = dsZone.Tables[0].Rows[j][
"DashboardItemName"].ToString() + "-" + dsZone.Tables[0].Rows[j]["DashboardItemId"].ToString();
NewRadDock.Height = 300;
NewRadDock.Width = 310;
NewRadDock.Skin =
"Web20";
NewRadDock.DockMode =
DockMode.Docked;
NewRadDock.ContentContainer.BackColor = System.Drawing.
Color.White;
NewRadDock.DockPositionChanged +=
new DockPositionChangedEventHandler(NewRadDock_DockPositionChanged);
NewRadDock.AutoPostBack =
true;
NewRadDock.ContentContainer.ScrollBars =
ScrollBars.None;
string name ="~/Account/Chart User Controls/" + dsZone.Tables[0].Rows[j]["UserControlName"].ToString() + ".ascx";;
FileInfo objFileifo = new FileInfo(Server.MapPath(name).ToString());
if (objFileifo.Exists)
{
Control userControl = LoadControl(name);
NewRadDock.ContentContainer.Controls.Add(userControl);
}
NewRadZone.Controls.Add(NewRadDock);
}
RadDockLayout1.Controls.Add(NewRadZone);
}
int cnt = RadMultiPage1.PageViews.Count;
RadMultiPage1.PageViews[RadTabStrip1.SelectedIndex].Controls.Add(RadDockLayout1);
}
catch (Exception ex)
{
Response.Write(
"Account_Dashboard.aspx_:BuildTab" + ex.Message.ToString());
}
}
and in user controls i am binding the chats through database.
so when i moved to a dashboard page it creates the zones (get zone info from database) then it creates the docks(get dock info from database) and in dock it adds the user controls
NewRadDock.ContentContainer.Controls.Add(userControl);
And inside every usercontrol I have a code to bind the charts( by calling the stored procs).
But to follow up the above whole procedure it takes lots of time to load/render the charts.
Please give me any way to start with.
Let me know if you want more info about the code and structure.
thanks
Vivek
Thanks
Vivek
How many items do you have in the chart when you are getting the slowdowns? RadChart will have problems with more than 1000 items on screen. While the product was designed to be easily customizable and feature rich it does not cope well with extremely busy charts. There is a trade off to make between high customization and high performance and we've gone the rich features path as it is what most of our customers are interested in.
To check whether the issue is with the charts rendering you can use ASP.NET trace or CLR Profiler and Firebug or a similar plug-in to investigate the client side performance.
Regards,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Did you try any of the above suggested tools to confirm where the delay comes from? In case it does come from RadChart rendering, did you check Todd's suggestions for async load using AJAX?
Sincerely,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.