VB.Net DataGrid Removing the last empty row

   I am developing a vb.net windows application . The data is shown on a datagrid. Some of the textboxes are editable and some are not. I have also a checkbox column on the datagrid, which is editable .

Is there a way to remove the last empty row appearing on the datagrid? If the datagrid is readonly the last empty row is not appearing  , but I have to make  some columns editable.


Who is Participating?
write this code in frm
frm - your formulario
dg - your Datagrid

Dim cm As CurrencyManager = _
         CType(Frm.BindingContext(dg.DataSource, dg.DataMember), _
      CType(cm.List, DataView).AllowNew = False


CType(dg.DataSource, DataView).AllowNew=False

Can your problem???
sgs1970Author Commented:
For checkbox to respond at single click, I added the fix from what is seen at

Under the heading
 ----  Customization 3: Make the Check Box Respond to One Click --

But because of this empty final row with the checkbox, clicking on the checkbox, gives additional empty row and clicking on this check box creates another empty new row. This is the real issue that I am facing. Atleast Preventing additional rows to come up will be a solution

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.