Пример #1
0
 protected void gvCustomCurrency_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException(nameof(e));
     }
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         if ((e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
         {
             Controls_mfbCustCurrency ccEdit = (Controls_mfbCustCurrency)e.Row.FindControl("mfbEditCustCurrency");
             ccEdit.Currency = (CustomCurrency)e.Row.DataItem;
         }
     }
 }
Пример #2
0
    protected void gvCustomCurrency_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e));
        }
        Controls_mfbCustCurrency ccEdit = (Controls_mfbCustCurrency)gvCustomCurrency.Rows[e.RowIndex].FindControl("mfbEditCustCurrency");

        if (ccEdit.Commit())
        {
            gvCustomCurrency.EditIndex = -1;
            RefreshCustomCurrencyList();
        }
        else
        {
            e.Cancel = true;
        }
    }