VB.Net DataGrid Removing the last empty row


 Hi,
   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.


 Thanks,
    samson

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

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

or

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

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

 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_CustDataGrid.asp
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

Sam
0
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.