Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
209 views
Hi,

We consistently get an "Out of memory." error when using GradientMode in a Pie Chart. 

No panic - we simply comment out this line
                csi.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Center; 

and all is fine.  The maximum # of items loaded in the series is 14.

Hope it's not something we're doing wrong!   :-)

Cheers ..


// .aspx 
 
        <telerik:RadChart ID="uxBreakup" runat="server" Width="700px" Height="450px">                     
            <ChartTitle> 
                <TextBlock Text="Recent Listings Category Breakup" /> 
             </ChartTitle> 
        </telerik:RadChart> 
 
        <telerik:RadChart ID="uxAllBreakup" runat="server" Width="700px" Height="450px"> 
            <ChartTitle> 
                <TextBlock Text="All Listings Category Breakup" /> 
             </ChartTitle> 
        </telerik:RadChart> 
 
//--------------------------------------------------------------------------------------- 
 
// .aspx.cs 
 
    public void BreakupReport() 
    { 
        DoBreakupReport(uxBreakup, reportStartDate, reportEndDate, "Breakup of Recent Listings"); 
        DoBreakupReport(uxAllBreakup, new DateTime(2000, 1, 1), new DateTime(2999, 1, 1), "Breakup of All Listings"); 
    } 
 
    public void DoBreakupReport(RadChart uxChart, DateTime start, DateTime finish, string title) 
    { 
        Color[] colors = { Color.FromArgb(40, 0, 187, 239), Color.FromArgb(0, 187, 239), 
                                    Color.FromArgb(40, 15, 191, 15), Color.FromArgb(15, 191, 15), 
                                    Color.FromArgb(40, 255, 179, 62), Color.FromArgb(255, 179, 62), 
                                    Color.FromArgb(40, 255, 79, 0), Color.FromArgb(255, 79, 0) }; 
 
        uxChart.Clear(); 
        ChartSeries csBreakup = uxChart.CreateSeries("Breakup", System.Drawing.Color.Goldenrod, System.Drawing.Color.Goldenrod, ChartSeriesType.Pie); 
 
        using (FetchSQL sql = new FetchSQL(string.Format("SELECT c.CategoryName, Count(*) FROM vwclassifiedadverts a inner join classifiedcategories c on a.ParentCategoryID=c.CategoryID " + 
                                            "WHERE StartUTC BETWEEN {0} AND {1} GROUP BY c.CategoryName ORDER BY c.CategoryName", 
                                           DB.MySqlDateTime(start), DB.MySqlDateTime(finish)))) 
        { 
            int i = 0; 
            while (sql.Read()) 
            { 
                ChartSeriesItem csi = new ChartSeriesItem(sql.AsInteger(1)); 
                csi.Label.TextBlock.Text = sql.AsString(0) + " - #%"; 
                csi.Name = sql.AsString(0); 
                csi.Appearance.FillStyle.MainColor = colors[i * 2]; 
                csi.Appearance.FillStyle.SecondColor = colors[i * 2 + 1]; 
                csi.Appearance.Border.Color = Color.DimGray; 
                csi.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; 
                //  .. this GradientFillStyle causes "OUt of Memory" 
                csi.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Center; 
                csBreakup.Items.Add(csi); 
                i = (++i) % 4;                 
            } 
        } 
 
        uxChart.ChartTitle.TextBlock.Text = title; 
    } 
 
 
//--------------------------------------------------------------------------------------- 
 
 
[OutOfMemoryException: Out of memory.] 
   System.Drawing.Drawing2D.PathGradientBrush..ctor(GraphicsPath path) +171505 
   Telerik.Charting.RenderEngine.GetGradientBrush(RectangleF rect, FillStyle fill) +1673 
   Telerik.Charting.RenderEngine.GetBrush(FillStyle fill, RectangleF rect) +963 
   Telerik.Charting.RenderEngine.RenderPieSeries(ChartSeries series, Int32 seriesIndex) +2322 
   Telerik.Charting.RenderEngine.Render(ChartSeries series, Int32 index) +639 
   Telerik.Charting.RenderEngine.RenderPlotAreaElements(Boolean withGrid, Boolean withTicks) +861 
   Telerik.Charting.RenderEngine.Render(IContainer element) +263 
   Telerik.Charting.Chart.GetImage(Int32 width, Int32 height) +405 
 
[ChartException: An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.] 
   Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex) +455 
   Telerik.Charting.Chart.GetImage(Int32 width, Int32 height) +639 
   Telerik.Web.UI.RadChart.RenderClassic(HtmlTextWriter writer) +166 
   Telerik.Web.UI.RadChart.RenderContents(HtmlTextWriter writer) +351 
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29 
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +9 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +7 
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59 
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896 
 
Giuseppe
Telerik team
 answered on 13 Feb 2009
4 answers
144 views
Hey guys.  I've searched around on the forums and through the documentation a bit, but still haven't found this. 
Our client needs to globalize every bit of text in the RadGrid and/or potentially all of the more elaborate controls (RadScheduler).
I've looked through the properties for the RadGrid and I don't see any localization sections.  I've also looked through the installation folder and haven't found anything. 

Are there any resource files in the source code to draw upon?  Is there anywhere in the documentation that would list each bit of text's resource key for the Grid?

Thanks a lot,

Adam.g
-DJ-
Top achievements
Rank 1
 answered on 13 Feb 2009
1 answer
123 views
Hi,
I am using a RadComboBox with an embedded RadTreeview. It is coded pretty much exactly as the samples were.
However I have AutoPostBack=True on the RadComboBox so I can catch the SelectedIndexChanged event on the server.
The only problem seems to be that the SelectedIndexChanged event does not happen until the RadCombo loses focus. I would like it to happen when the user selects an item in the treeview.
Below is the client side code I have attached to the combo.
Any help would be great.
Thanks ... Ed

function tvCombo_Load(sender, eventArgs)  
{  
    sender.set_text(sender.get_items().getItem(0).get_value());  
}  
function tvCombo_NodeClicking(sender, args)  
{  
    var node = args.get_node();  
    var tv = node.get_treeView();  
    var bLeavesOnly = tv.get_attributes().getAttribute("LeavesOnly");  
    var cboId = tv.get_attributes().getAttribute("cboId");  
 
    if (bLeavesOnly == "true") // they can only select leaves  
    {  
        // add in the following code as a condition to disable root nodes that are leaves from being selected   
        //  || node.get_parent().get_parent() == null  
        if (node.get_nodes().get_count() > 0)   
        {  
            args.set_cancel(true);  
            return;  
        }  
    }  
    var ddl = $find(cboId);  
    ddl.trackChanges();  
    ddl.set_text(node.get_text());  
    ddl.get_items().getItem(0).set_value(node.get_text());  
    ddl.commitChanges();  
    ddl.hideDropDown();  
}  
function tvCombo_StopPropagation(e)  
{  
    if (!e)  
        e = window.event;  
    e.cancelBubble = true;  
}  
function tvCombo_OnClientDropDownOpenedHandler(sender, eventArgs)  
{  
    var cboItem = sender.get_items().getItem(0);  
    var treeId = sender.get_attributes().getAttribute("tvId");  //cboItem.get_attributes().getAttribute("TreeId");  
    if (treeId)  
    {  
        var tv = cboItem.findControl(treeId);  
        var selectedNode = tv.get_selectedNode();  
          
        if (selectedNode)  
        {  
            // expand the parents  
            var oNode = selectedNode.get_parent();  
            while (oNode)  
            {  
                // can't expand the root's parent as it is the treeview itself  
                if(oNode.get_parent())  
                    oNode.expand();  
                oNodeoNode = oNode.get_parent();  
            }  
 
            selectedNode.scrollIntoView();  
        }  
    }  
} 
Simon
Telerik team
 answered on 13 Feb 2009
7 answers
281 views
I've posted this before, but the solution did not work.

I cannot get the value of the selected item in the slider control on post back.
I just give me the index of the selected item.

I must have some strange setting or doing something crazy because this must work:
Below is the slider control I've used for testing and on a simple button click (server side) I cannot get the correct value. Just gives me the index.

I'm using the latest version of the telerik controls.

                                                <telerik:RadSlider runat="server" ID="rsVery" EnableViewState="true" Orientation="Horizontal" Width="500" Height="50" TrackPosition="TopLeft" Skin="Inox" ItemType="Item" SmallChange="1" ShowDecreaseHandle="true" ShowIncreaseHandle="true" AnimationDuration="250">
                                                    <Items>
                                                        <telerik:RadSliderItem Text="Very Slow" Value="22" ToolTip="Very Slow" runat="server"></telerik:RadSliderItem>
                                                        <telerik:RadSliderItem Text="Slow" Value="33" runat="server"></telerik:RadSliderItem>
                                                        <telerik:RadSliderItem Text="Normal" Value="44" runat="server"></telerik:RadSliderItem>
                                                        <telerik:RadSliderItem Text="Fast" Value="55" runat="server"></telerik:RadSliderItem>
                                                        <telerik:RadSliderItem Text="Very Fast" Value="66" runat="server"></telerik:RadSliderItem>
                                                    </Items>
                                                </telerik:RadSlider>
Tsvetie
Telerik team
 answered on 13 Feb 2009
3 answers
243 views
I have a set of dock zones with docks in them. Some docks are added via postbacks as per you examples.

When
1. a Dock as been undocked by a user and dragged elsewhere, and
2. a postback occurs (even if no event handler is called)
The undocked dock is cloned. If the user drags it it reveals another copy of it which was beneath it.

If then
3. a second postback occurs (even if no event handler is called)

Then I get:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":309,"Left":302,"DockZoneID":"","Collapsed":false,"Pinned":false,"Resizable":true,"Closed":false,"Width":"47%","Height":null,"ExpandedHeight":0,"Index":0}.

I think I've narrowed it down to the Page_Init code as per your sample

 

List<DockState> currentDockStates = CurrentDockStates;

 

 

for (int i = 0; i < currentDockStates.Count; i++)

 

{

 

RadDock dock = new RadDock();

 

dock.ID =

string.Format("ChartDock{0}", i);

 

dock.ApplyState(currentDockStates[i]);

RadDockLayout1.Controls.Add(dock);

LoadWidget(dock);

}

but  am at a loss as to how to fix it.
Do you have any suggestions?

thanks

Petio Petkov
Telerik team
 answered on 13 Feb 2009
1 answer
129 views
Hi I have a question related to radwindows. I am using it for a wizard kind of registration, the only problem is that if the user press F5 to refresh the browser it closes the radwindow and refreshes the main broswer page. Is there anyway that we can prevent this?

Thanks
Atiq
Fiko
Telerik team
 answered on 13 Feb 2009
12 answers
800 views
Hi,

I wanted to number the rows so that if there are 10 rows i wanted radgrid to display it from 1-10. I used the code below but keep having "System.Data.DataRowView" in the rows.

Dim rowLength As Integer

        For rowLength = 1 To RadGrid1.Items.Count
            RadGrid1.Items.Item(1).Cells.Item(1).Text = rowLength - 1
        Next

Is there any other way doing it so that it can display it on the rows of radgrid.


Thanks
GarryP
Top achievements
Rank 1
 answered on 13 Feb 2009
3 answers
161 views
Hi all, I'm looking for a good example of sorting, filtering and paging implementing the NeedDataSource event.  I can't seem to get the grid to sort properly.

I can't seem to find an example where paging is involved

Thanks
Sebastian
Telerik team
 answered on 13 Feb 2009
1 answer
98 views
Hi,
I have a chart that displays the qty (y axis) against salesperson (x axis).

The problem i am having is, when the hightest qty is a low number (eg; 2) the major ticks shown are 0.2, 0.4, 0.6 etc...
I dont want this, i just want whole numbers to be shown.
I cant use autoscale (i assume this) as i dont know what the qty will be until the chart is generated.

Can you please help ?
Thanks
Mark
Ves
Telerik team
 answered on 13 Feb 2009
3 answers
127 views
is there any way for .scrollIntoView() be done server side?
all the references i've seen for it to work is from the client side...

thanks in advance team telerik

regards,
coldapoy
Gordon
Top achievements
Rank 1
 answered on 13 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?