Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catching grid row changes and updating BO Entity???
Message
De
25/10/2007 21:27:07
 
 
À
25/10/2007 21:10:46
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01263718
Message ID:
01263914
Vues:
11
> Is there a different CellEnter for each column that you have to deal with, or is it a grid-level event that will fire for all cells in all columns?

Grid-level. This might help (cut from a working app):

Form.cs:
  // constructor  (Bizobj type is "OrderForm")
    OrderForm  oOrderForm = (OrderForm)RegisterBizObj(new OrderForm());
 ...

  private void grdOrderForm_CellEnter(
       object sender, DataGridViewCellEventArgs e)
  {
     // What row are we on now?
     DataRowView dr = grdOrderForm.GetCurrentRow();

     // enable/disable buttons as appropriate
     btnOrderDelete.Enabled = (dr != null);
     btnOrderEdit.Enabled = (dr != null);
     btnViewOrderItems.Enabled = (dr != null
                         && status == OrderStatus.Complete);
   // etc etc
  }
Form.designer.cs:
  this.grdOrderForm = new ... DataGridView();
  ...
  this.grdOrderForm.BindingSource = "OrderForm";
  this.grdOrderForm.BindingSourceMember = null;
  ..
  this.grdOrderForm.CellEnter += new
     System.Windows.Forms.DataGridViewCellEventHandler(
             this.grdOrderForm_CellEnter );
- Walter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform