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!
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!