AutoPostBack into ContentPlaceHolder

4 posts, 0 answers
  1. DrGiorgini
    DrGiorgini avatar
    11 posts
    Member since:
    Jul 2010

    Posted 14 Jan 2011 Link to this post

    Hi all,
    here my code:
    <%@ Page Title="" Language="C#" MasterPageFile="~/DrgiorginiAdmin.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DrGiorginiAdmin.Default" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder1" runat="server">

            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
                SelectCommand="SELECT * FROM [Category]"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
                SelectCommand="SELECT DISTINCT [Year] FROM [Data]"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
                SelectCommand="SELECT SC.Name, D.Year, D.Value FROM (Category AS C INNER JOIN Subcategory AS SC ON C.Id=SC.Category_id) INNER JOIN Data AS D ON SC.ID=D.SubCategory_Id WHERE C.ID=@Id ORDER BY C.ID, SC.ID, Year;">
                <SelectParameters>
                    <asp:ControlParameter ControlID="dropDownCategory" DefaultValue="2" Name="Id" PropertyName="SelectedValue" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
                SelectCommand="SELECT SUM(Value) AS [Sum], C.Name FROM (Category AS C INNER JOIN Subcategory AS SC ON C.Id=SC.Category_id) INNER JOIN [Data] AS D ON SC.ID=D.SubCategory_Id WHERE [Year]=@Year GROUP BY C.ID, C.Name ORDER BY C.ID">
                <SelectParameters>
                    <asp:ControlParameter ControlID="dropDownYears" DefaultValue="1996" Name="Year" PropertyName="SelectedValue" />
                </SelectParameters>
            </asp:SqlDataSource>

            <strong>Binding to a DataSource Control - bar series and grouping</strong><br />
            <label for="dropDownCategory">
                <asp:Label ID="Label2" runat="server" class="text">GDP by Industry:</asp:Label>
            </label>
            <asp:DropDownList ID="dropDownCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="dropDownCategory_SelectedIndexChanged"
                Width="225px" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Id">
            </asp:DropDownList><br />
            <telerik:RadChart ID="RadChart1" runat="server" Width="710px" OnDataBound="RadChart1_DataBound"
                DataGroupColumn="Name" AutoTextWrap="true" DataSourceID="SqlDataSource3" Skin="LightBlue">
                <Legend>
                    <Appearance GroupNameFormat="#VALUE">
                    </Appearance>
                </Legend>
                <PlotArea>
                    <XAxis DataLabelsColumn="Year">
                    </XAxis>
                </PlotArea>
            </telerik:RadChart>
            <br />
            <strong>Binding to a DataSource control - pie series</strong>
            <br />
            <asp:Label ID="Label1" runat="server" class="text">GDP by Year: </asp:Label>
            <asp:DropDownList ID="dropDownYears" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
                DataTextField="Year" DataValueField="Year">
            </asp:DropDownList><br />
            <telerik:RadChart ID="RadChart2" runat="server" DefaultType="Pie" Width="710px" AutoTextWrap="true"
                OnItemDataBound="RadChart2_ItemDataBound" DataSourceID="SqlDataSource4" Skin="LightGreen">
                <Appearance Dimensions-Width="710px">
                </Appearance>
                <Series>
                    <telerik:ChartSeries Name="Series 1" Type="Pie" DataYColumn="Sum">
                        <Appearance LegendDisplayMode="ItemLabels">
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
            </telerik:RadChart>
            <br />
            <!-- content end -->

    </asp:Content>

    This page is enclosed inside a MasterPage.
    When I change the value in the dropdownlist happen two strange facts (probably a context to another):
    part of the layout is modified and after you run the command to change the content to the chart at the bottom right scroll bar begins to load (do not know what).
    I know it will be stupid, but because you are noob asking for help.
    Thanks in advance!

  2. DrGiorgini
    DrGiorgini avatar
    11 posts
    Member since:
    Jul 2010

    Posted 16 Jan 2011 Link to this post

    Anyone can help me ?
  3. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 20 Jan 2011 Link to this post

    Hi Filippo,

    As I was able to see from your picture attached you are using the same code as in our demo - http://demos.telerik.com/aspnet-ajax/chart/examples/appscenarios/dyndata/defaultcs.aspx. However there is no scrollbar ...Could you open a Support thread and send us a sample project where your issue reproduces so that we will be able to investigate it and help you?

    All the best,
    Evgenia
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  4. DrGiorgini
    DrGiorgini avatar
    11 posts
    Member since:
    Jul 2010

    Posted 20 Jan 2011 Link to this post

    I thank you greatly for the reply, I solved within the master page because it contained a Jquery that bothered the layout.
    Thanks anyway!
Back to Top