ok, this is my code behind
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Drawing;
using System.Data;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using Asialife.Life.D ata;
using Asialife.Shared ;
using Asialife.Shared .Data;
using Asialife.Shared .Entity;
using Asialife.Common .Charts;
namespace Asialife.NetToo ls
{
public class LILPFUND_CN : System.Web.UI.P age
{
protected Label UserLabel, MessageLabel, TitleLabel;
protected HtmlForm GridForm;
protected DataGrid ILPListing, ILPFundListing;
protected System.Web.UI.W ebControls.Imag e ChartImage;
protected DropDownList PeriodList;
private ILPData ilpData;
private void Page_Load(objec t sender, System.EventArg s e)
{
initField();
if ((string)Sessio n["dataViewID "]!="LILPFUND")
{
Session["dataViewID "] = "LILPFUND";
GetData();
}
else
{
bindGrid(1);
bindGrid(2);
}
}
private void GetData()
{
ilpData = new ILPData(PeriodL ist.SelectedIte m.Value);
ilpData.Connect ();
ilpData.Retriev e();
ilpData.Disconn ect();
if (ilpData.IsExis t)
{
Session["dataView"] = new DataView(ilpDat a.ReportTable);
Session["dataView1"] = new DataView(ilpDat a.ReportTable);
((DataView)Sess ion["dataView"]).RowFilter="Da te > '" +
DateTime.Today. AddDays(-8) + "' AND Date < '" + DateTime.Today + "'";
((DataView)Sess ion["dataView"]).RowStateFilte r=
DataViewRowStat e.CurrentRows;
((DataView)Sess ion["dataView1"]).RowFilter="Fu nd = '" +
((DataView)Sess ion["dataView1"])[0]["Fund"] + "'";
((DataView)Sess ion["dataView1"]).Sort="Date";
((DataView)Sess ion["dataView1"]).RowStateFilte r=
DataViewRowStat e.CurrentRows;
TitleLabel.Text =
((DataView)Sess ion["dataView1"])[0]["Fund"].ToString();
MessageLabel.Te xt="";
}
else
{
MessageLabel.Te xt="No Records Found !";
}
bindGrid(1);
bindGrid(2);
}
public void ILPGridPageChan ged(object sender,
DataGridPageCha ngedEventArgs e)
{
ILPListing.Curr entPageIndex = e.NewPageIndex;
bindGrid(1);
}
public void ILPFundGridPage Changed(object sender,
DataGridPageCha ngedEventArgs e)
{
ILPFundListing. CurrentPageInde x = e.NewPageIndex;
bindGrid(2);
}
public void fundSelected(ob ject sender, DataGridCommand EventArgs e)
{
TitleLabel.Text = e.Item.Cells[1].Text;
((DataView)Sess ion["dataView1"]).RowFilter="Fu nd = '" +
e.Item.Cells[1].Text + "'";
((DataView)Sess ion["dataView1"]).RowStateFilte r=
DataViewRowStat e.CurrentRows;
bindGrid(2);
}
public void PeriodChanged(o bject sender, System.EventArg s e)
{
initGrid(1);
initGrid(2);
GetData();
}
private void initGrid(int gridNo)
{
switch(gridNo)
{
case 1:
ILPListing.Curr entPageIndex=0;
ILPListing.Data Source = new DataView();
ILPListing.Data Bind();
break;
case 2:
ILPFundListing. CurrentPageInde x=0;
ILPFundListing. DataSource = new DataView();
ILPFundListing. DataBind();
break;
}
}
private void bindGrid(int gridNo)
{
switch(gridNo)
{
case 1:
ILPListing.Data Source = (DataView)Sessi on["dataView"];
ILPListing.Data Bind();
break;
case 2:
ILPFundListing. DataSource = (DataView)Sessi on["dataView1"];
ILPFundListing. DataBind();
break;
}
}
private void initField()
{
if (!IsPostBack)
{
PeriodList.Item s.Add(new ListItem("Áù¸öÔ Â",
DateTime.Today. AddMonths(-6).ToString("yy yyMMdd")) );
PeriodList.Item s.Add(new ListItem("Ò»Äê" ,
DateTime.Today. AddYears(-1).ToString("yy yyMMdd")) );
PeriodList.Item s.Add(new ListItem("Á½Äê" ,
DateTime.Today. AddYears(-2).ToString("yy yyMMdd")) );
PeriodList.Item s.Add(new ListItem("ÎåÄê" ,
DateTime.Today. AddYears(-5).ToString("yy yyMMdd")) );
}
initGrid(1);
initGrid(2);
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
}
}
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!