or
Dim
lineMonthlyProfits
As
New
LineSeries
Dim
lineTotalProfits
As
New
LineSeries
Dim
yAxisTotalProfits
As
New
AxisY
Do
While
ChartingMonth < Now()
GrossProfit = 0 : Fees = 0
'Code here that pulls values from db
TotalProfit += GrossProfit - Fees
lineMonthlyProfits.SeriesItems.Add(
CInt
(GrossProfit - Fees))
lineTotalProfits.SeriesItems.Add(Int(TotalProfit))
chartMonthlyProfits.PlotArea.XAxis.Items.Add(
CStr
(Month(ChartingMonth)) &
"/"
& Right(
CStr
(Year(ChartingMonth)), 2))
ChartingMonth = DateAdd(DateInterval.Month, 1, ChartingMonth)
Loop
lineMonthlyProfits.Name =
"Monthly Profit"
lineMonthlyProfits.LabelsAppearance.DataFormatString =
"{0:c0}"
lineTotalProfits.LabelsAppearance.DataFormatString =
"{0:c0}"
chartMonthlyProfits.PlotArea.Series.Add(lineMonthlyProfits)
chartMonthlyProfits.PlotArea.YAxis.MaxValue = 20000
'Not needed but in place for testing purposes
yAxisTotalProfits.Name =
"Total Profits"
chartMonthlyProfits.PlotArea.AdditionalYAxes.Add(yAxisTotalProfits)
chartMonthlyProfits.PlotArea.XAxis.AxisCrossingPoints.Add(0)
chartMonthlyProfits.PlotArea.XAxis.AxisCrossingPoints.Add(lineTotalProfits.SeriesItems.Count)
lineTotalProfits.Name = yAxisTotalProfits.Name
chartMonthlyProfits.PlotArea.Series.Add(lineTotalProfits)
chartMonthlyProfits.PlotArea.YAxis.LabelsAppearance.DataFormatString =
"{0:c0}"
chartMonthlyProfits.PlotArea.YAxis.MinorGridLines.Visible =
False
chartMonthlyProfits.PlotArea.XAxis.MinorGridLines.Visible =
False
chartMonthlyProfits.PlotArea.XAxis.MajorGridLines.Visible =
False
chartMonthlyProfits.Legend.Appearance.Visible =
False
function GetRadWindow() { |
var oWindow = null; |
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog |
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well) |
return oWindow; |
} |
function CloseOnReload() { |
GetRadWindow().Close(); |
} |
Is there any way to stop the postback when the user clicks the Cancel button or the 'X'?
Thanks.
Steve
<?
xml
version
=
"1.0"
?>
<!--
For more information on how to configure your ASP.NET application, please visit
-->
<
configuration
>
<!--
For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <
httpRuntime
> tag.
<
system.Web
>
<
httpRuntime
targetFramework
=
"4.5"
/>
</
system.Web
>
-->
<
system.web
>
<
compilation
debug
=
"true"
targetFramework
=
"4.5"
>
<!-- this section is added because it was in the VS2013 solution -->
<
assemblies
>
<
add
assembly
=
"System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
assemblies
>
<!-- end section added -->
</
compilation
>
<!-- this section is added because it was in the VS2013 solution -->
<
httpRuntime
targetFramework
=
"4.5"
/>
<!-- end section added -->
<
pages
controlRenderingCompatibilityVersion
=
"4.0"
/>
<
httpHandlers
>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
</
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
handlers
>
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
verb
=
"*"
preCondition
=
"integratedMode"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
/>
</
handlers
>
</
system.webServer
>
</
configuration
>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridTest.aspx.cs" Inherits="EmptyVs2012withTelerik.GridTest" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager1"
runat
=
"server"
>
</
telerik:RadStyleSheetManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
>
</
asp:ScriptReference
>
</
Scripts
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowPaging
=
"True"
CellSpacing
=
"0"
GridLines
=
"None"
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
namespace
EmptyVs2012withTelerik
{
public
partial
class
GridTest : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
var persons =
new
List<Person>();
persons.Add(
new
Person() { FirstName =
"Jan"
, LastName =
"Hansen"
, Age = 37 });
persons.Add(
new
Person() { FirstName =
"Jannik"
, LastName =
"Meibom"
, Age = 39 });
persons.Add(
new
Person() { FirstName =
"Anne"
, LastName =
"Hansen"
, Age = 40 });
persons.Add(
new
Person() { FirstName =
"Jan"
, LastName =
"Hansen"
, Age = 37 });
persons.Add(
new
Person() { FirstName =
"Jannik"
, LastName =
"Meibom"
, Age = 39 });
persons.Add(
new
Person() { FirstName =
"Anne"
, LastName =
"Hansen"
, Age = 40 });
persons.Add(
new
Person() { FirstName =
"Jan"
, LastName =
"Hansen"
, Age = 37 });
persons.Add(
new
Person() { FirstName =
"Jannik"
, LastName =
"Meibom"
, Age = 39 });
persons.Add(
new
Person() { FirstName =
"Anne"
, LastName =
"Hansen"
, Age = 40 });
persons.Add(
new
Person() { FirstName =
"Jan"
, LastName =
"Hansen"
, Age = 37 });
persons.Add(
new
Person() { FirstName =
"Jannik"
, LastName =
"Meibom"
, Age = 39 });
persons.Add(
new
Person() { FirstName =
"Anne"
, LastName =
"Hansen"
, Age = 40 });
persons.Add(
new
Person() { FirstName =
"Jan"
, LastName =
"Hansen"
, Age = 37 });
persons.Add(
new
Person() { FirstName =
"Jannik"
, LastName =
"Meibom"
, Age = 39 });
persons.Add(
new
Person() { FirstName =
"Anne"
, LastName =
"Hansen"
, Age = 40 });
RadGrid1.DataSource = persons;
}
}
public
class
Person
{
public
string
FirstName {
get
;
set
; }
public
string
LastName {
get
;
set
; }
public
int
Age {
get
;
set
; }
}
}