Guest Herbert Guerrero Posted November 5, 2006 Share Posted November 5, 2006 Problem: It does not update my DataGrid when using a For loop.Goal: To be able to update my DataGrid through Automation such as a "for" loop. My first try was to execute the code from a Timer Component.What I have tried so far: 1. I added a Timer Component in order to call the code below. Then I placed the code under the Page_Load and added a redirect under the Timer Component. 2. It does work when I added the code under a button and I click on it manually.Code:I have the following code on Page_Load on my aspx file:if (!IsPostBack ){ dt.Clear(); for (int x = 1; x <= 3; x++) { DataRow dr = dt.NewRow(); dr[0] = "ServiceName" + x; //name dr[1] = "ACD" + DateTime.Now; //type dr[2] = x; //calls inqueue dr[3] = x+1; //longest dr[4] = x+2; //loggedin dr[5] = x+3; //not ready dr[6] = x+1; //busy dr[7] = x+2; //idle dt.Rows.Add(dr); } DataView dv = new DataView(dt); DataStats.DataSource = dv; DataStats.DataBind();}Then I added a Timer Component to the aspx and type the following on the Timer_Elapsed Event:Response.Redirect("AgentUserId.aspx"); Link to comment Share on other sites More sharing options...
aspnetguy Posted November 5, 2006 Share Posted November 5, 2006 I assume you have your datacolumn already defined? Can you post the code for hte whole page. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now