Esempio n. 1
0
 //fungsi: Refresh GridView
 protected void btnRefresh_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         //update ke grid
         GvSalary.DataBind();
     }
 }
Esempio n. 2
0
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GvSalary.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

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