protected void GvIjin_RowEditing(object sender, GridViewEditEventArgs e) { if (Page.IsValid) { GvIjin.EditIndex = e.NewEditIndex; GvIjin.DataBind(); this.ScriptManager1.SetFocus(GvIjin.Rows[e.NewEditIndex].Cells[0].FindControl("txtCol1Edit").ClientID); } else { e.Cancel = true; } }
protected void txtHalaman_TextChanged(object sender, EventArgs e) { GridViewRow rowPager = GvIjin.BottomPagerRow; TextBox txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman")); try { if (int.Parse(txtHalaman.Text) <= GvIjin.PageCount + 1 && int.Parse(txtHalaman.Text) > 0) { GvIjin.PageIndex = (int.Parse(txtHalaman.Text)) - 1; GvIjin.DataBind(); } } catch (Exception) { txtHalaman.Text = (GvIjin.PageIndex + 1).ToString(); } }