Windows Forms Datagrid

  • Thread starter Thread starter Bernardo
  • Start date Start date
B

Bernardo

Hi,

I want to have a grid whith only one field updatable (a
checkbox), but if I put the grid ReadOnly I can't change
the field, and if I put the grid ReadOnly = false a new
record line appears.
There is any way to don't display the new record line and
let just one field to be editable?

There is any way to now by mouseMove event if I'm moving
the mouse over a specified field?

Thanks a lot
 
There is any way to don't display the new record line and
let just one field to be editable?

1. You can make certain columns read-only by employing such classes as
DataGridTableStyle and DataGridColumnStyle.
2. You can suppress the "add new" row with the following code (should be run
right after the grid has been bound to data):

CurrencyManager cm = (CurrencyManager)this.BindingContext[grid.DataSource,
grid.DataMember];
DataView view = (DataView)cm.List;
view.AllowNew = false;
There is any way to now by mouseMove event if I'm moving
the mouse over a specified field?

You can use the grid's HitTest method to determine which part of the grid is
currently under the mouse pointer.
 
Back
Top