Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Catching grid row changes and updating BO Entity???
Message
From
25/10/2007 21:27:07
Walter Nicholls
Cornerstone Software Ltd
Auckland, New Zealand
 
 
To
25/10/2007 21:10:46
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01263718
Message ID:
01263914
Views:
10
> 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
Previous
Reply
Map
View

Click here to load this message in the networking platform