Remove the "auto row insertion" of Datagrid

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi all

Is it possible to remove/disable automatic new row insertion feature in
datagrid control(last row with * on the left)? I'm implementing a datagrid
table which consists of 4 columns and allow user to enter data in row (no
database involved). When it is done, I will populate the data from this
table into an arraylist. Anway, this works greate except when user enters
invalid data in the new row and clicks on the new insertion row( the one
with *), sometimes I have "out of index". I tried to debug but I couldn't
figgure out where my code went wrong. However, if I can control when to
allow user to add a new row to the datagrid, then it would my life much
easier.

My question is: Is it possible to disable the automatic new row insertion
and only add a new row when user click on a button

Regards,

Sam
 
Sam,

Set the dataview you use to
dv.allownew = false
When you use a datatable
dt.defaultview.allwonew = false

When you want than to add a row in an event you have temporaly to set it to
allownew = true and at the end to allownew = false.

The user would not see that because inside a sub is no window painting.

I hope this helps?

Cor
 
Back
Top