public void grdContingency_UpdateCommand(object sender, DataGridCommandEventArgs e)
    {
        String DetailId = "";

        DetailId = grdContingency.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString();
        Whitfieldcore _wc = new Whitfieldcore();
        _wc.UpdateContingencyRecord(Convert.ToInt32(ViewState["EstNum"].ToString()), Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtqty"))).Text.ToString(), ((TextBox)(e.Item.FindControl("txtcost"))).Text.ToString());
        grdContingency.EditItemIndex = -1;
        grdContingency.ShowFooter = true;
        BindContingency(Convert.ToInt32(ViewState["EstNum"].ToString()));
    }