VB.Net DataGrid Removing the last empty row

Posted on 2006-04-11
Last Modified: 2008-03-10

   I am developing a 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.


Question by:sgs1970

    Author Comment

    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

    LVL 1

    Accepted Solution

    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???

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now