Exemple #1
0
 protected void GvPPHStatus_RowEditing(object sender, GridViewEditEventArgs e)
 {
     if (Page.IsValid)
     {
         GvPPHStatus.EditIndex = e.NewEditIndex;
         GvPPHStatus.DataBind();
         this.ScriptManager1.SetFocus(GvPPHStatus.Rows[e.NewEditIndex].Cells[0].FindControl("ddlCol3Edit").ClientID);
     }
     else
     {
         e.Cancel = true;
     }
 }
Exemple #2
0
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GvPPHStatus.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

            try
            {
                if (int.Parse(txtHalaman.Text) <= GvPPHStatus.PageCount + 1 && int.Parse(txtHalaman.Text) > 0)
                {
                    GvPPHStatus.PageIndex = (int.Parse(txtHalaman.Text)) - 1;
                    GvPPHStatus.DataBind();
                }
            }
            catch (Exception)
            {
                txtHalaman.Text = (GvPPHStatus.PageIndex + 1).ToString();
            }
        }