Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Monday, 2 June 2014

Events of Control Inside the GridView and FinControl inside GridView

protected void ddlRansport_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string str = "Owned";
                DropDownList ddl = (DropDownList)sender;
                GridViewRow row = (GridViewRow)ddl.Parent.Parent;
                int idx = row.RowIndex;
                TextBox txtKm = (TextBox)row.Cells[0].FindControl("txt" + str + "KmTravelled");
                TextBox txtAmnt = (TextBox)row.Cells[0].FindControl("txt" + str + "AmountClaimed");
                txtAmnt.Text = Convert.ToString(Math.Round(decimal.Multiply(Convert.ToDecimal(txtKm.Text), Convert.ToDecimal(ddl.SelectedValue))));
            }
            catch (Exception ex)
            {
                com.ExceptionLog(ex);
            }
        }

 string str = "Owned";
                TextBox txtKm = (TextBox)sender;
                GridViewRow row = (GridViewRow)txtKm.Parent.Parent;
                DropDownList ddl = (DropDownList)row.Cells[0].FindControl("ddl" + str + "ModeofTRansport");
                TextBox txtAmnt = (TextBox)row.Cells[0].FindControl("txt" + str + "AmountClaimed");
                txtAmnt.Text = Convert.ToString(Math.Round(decimal.Multiply(Convert.ToDecimal(txtKm.Text), Convert.ToDecimal(ddl.SelectedValue))));
           

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.