Пример #1
0
 protected void GVTimeCard_RowEditing(object sender, GridViewEditEventArgs e)
 {
     if (Page.IsValid)
     {
         GVTimeCard.EditIndex = e.NewEditIndex;
         GVTimeCard.DataBind();
         this.ScriptManager1.SetFocus(GVTimeCard.Rows[e.NewEditIndex].Cells[1].FindControl("txtCol1Edit").ClientID);
     }
     else
     {
         e.Cancel = true;
     }
 }
Пример #2
0
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GVTimeCard.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

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