?
Solved

VB.Net DataGrid Removing the last empty row

Posted on 2006-04-11
2
Medium Priority
?
1,106 Views
Last Modified: 2008-03-10

 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

   
 
0
Comment
Question by:sgs1970
2 Comments
 

Author Comment

by:sgs1970
ID: 16426828
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
 
LVL 1

Accepted Solution

by:
jesusaflores earned 1000 total points
ID: 16427716
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month16 days, 1 hour left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question