コード例 #1
0
        protected void ddlCol5FormView_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList ddlKredit = (DropDownList)sender;

            if (ddlKredit.SelectedValue == "0")
            {
                ((TextBox)FvIjin.FindControl("txtCol6FormView")).Text               = "0";
                ((TextBox)FvIjin.FindControl("txtCol6FormView")).Enabled            = false;
                ((DropDownList)FvIjin.FindControl("ddlCol7FormView")).SelectedValue = "0";
                ((DropDownList)FvIjin.FindControl("ddlCol7FormView")).Enabled       = false;
                ((DropDownList)FvIjin.FindControl("ddlCol8FormView")).SelectedValue = "1";
                ((DropDownList)FvIjin.FindControl("ddlCol8FormView")).Enabled       = false;
            }
            else
            {
                ((TextBox)FvIjin.FindControl("txtCol6FormView")).Enabled      = true;
                ((DropDownList)FvIjin.FindControl("ddlCol7FormView")).Enabled = true;
                ((DropDownList)FvIjin.FindControl("ddlCol8FormView")).Enabled = true;
            }
        }
コード例 #2
0
 protected void lblTambah_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         //Seleksi apakah data kosong atau tidak,
         //jika kosong maka proses tambah data dilakukan melalui formView,
         //jika tidak kosong maka proses tambah data dilakukan melalui GridView,
         if (GvIjin.Rows.Count > 0)
         {
             //Data tidak kosong
             sendToLastPage    = true;
             GvIjin.ShowFooter = true;
             this.ScriptManager1.SetFocus(GvIjin.FooterRow.Cells[0].FindControl("txtCol0Footer").ClientID);
         }
         else
         {
             //Data Kosong
             FvIjin.DefaultMode = FormViewMode.Insert;
             FvIjin.DataBind();
             this.ScriptManager1.SetFocus(FvIjin.FindControl("txtCol0FormView").ClientID);
         }
     }
 }