protected void Paginate(object sender, CommandEventArgs e) { // get the current page selected int intCurIndex = GridViewWFStepsNames.PageIndex; switch (e.CommandArgument.ToString().ToLower()) { case "first": GridViewWFStepsNames.PageIndex = 0; break; case "prev": GridViewWFStepsNames.PageIndex = intCurIndex - 1; break; case "next": GridViewWFStepsNames.PageIndex = intCurIndex + 1; break; case "last": GridViewWFStepsNames.PageIndex = GridViewWFStepsNames.PageCount; break; } // popultate the gridview control // PopulateGrid(); GridViewWFStepsNames.DataSource = dt; GridViewWFStepsNames.DataBind(); }
protected void ddlPages_SelectedIndexChanged(Object sender, EventArgs e) { GridViewRow gvrPager = GridViewWFStepsNames.BottomPagerRow; DropDownList ddlPages = (DropDownList)gvrPager.Cells[0].FindControl("ddlPages"); GridViewWFStepsNames.PageIndex = ddlPages.SelectedIndex; // a method to populate your grid // PopulateGrid(); GridViewWFStepsNames.DataSource = dt; GridViewWFStepsNames.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string language = Session["mylang"].ToString(); check.LanguageCheck(language); base.InitializeCulture(); if (Request.QueryString["workflowname"] != null) { workflowname = Request.QueryString["workflowname"]; txtboxWorkflow.Text = workflowname; } if (Request.QueryString["wfname"] != null) { stepname = Request.QueryString["wfname"]; txtboxStepName.Text = stepname; } if (Request.QueryString["stepId"] != null) { stepId = Request.QueryString["stepId"]; //lbl.Text = stepId; } if (Request.QueryString["wfname1"] != null) { workflowname = Request.QueryString["wfname1"]; txtboxWorkflow.Text = workflowname; } if (Request.QueryString["stepname"] != null) { stepname = Request.QueryString["stepname"]; txtboxStepName.Text = stepname; } // if (Request.QueryString["stepid1"] != null) //{ // stepId = Request.QueryString["stepid1"]; // lbl.Text = stepId; //} WorkflowsService wfservice = new WorkflowsService(); List <LoadWorkflowTaskDTO> loadWFTaskDtos = wfservice.LoadTask(stepId, workflowname); if (loadWFTaskDtos.Count > 0) { DataTable dtsteps = new DataTable(); dtsteps.Columns.Add("Name", typeof(string)); dtsteps.Columns.Add("Id", typeof(string)); foreach (LoadWorkflowTaskDTO wfs in loadWFTaskDtos) { DataRow row = dtsteps.NewRow(); row["Id"] = wfs.wftask_Id; row["Name"] = wfs.emp_Name; dtsteps.Rows.Add(row); } GridViewWFStepsNames.DataSource = dtsteps; GridViewWFStepsNames.DataBind(); GridViewWFStepsNames.Columns[1].Visible = false; ViewState["dtTable"] = dtsteps; } }