Making an entire column editable

Posted on 2005-05-09
Last Modified: 2010-04-23
I have been having the most terrible time trying to make an entire column editable.  So far I can only get the first two rows of the column "Results" editable.  The datagrid results are showing 7 rows but I can only edit the first two for some reason.  Can anyone supply me with some VERY easy, step by step instructions for doing this?
Question by:johnqtr
    1 Comment
    LVL 62

    Accepted Solution

    When you create the DataColumn for the DataGrid by default the ReadOnly property is set to False. This will allow all the cells in that column to be editable.

            ' Add column Period number
            dc = New DataColumn
            With dc
                .ColumnName = "Period"
                .DataType = System.Type.GetType("System.String")
                .ReadOnly = False
            End With

            ' Add column Principal amount
            dc = New DataColumn
            With dc
                .ColumnName = "Principal"
                .DataType = System.Type.GetType("System.String")
                .ReadOnly = True
            End With

    In the above code column "Period" can be edited and column "Principal" can not be edited. Make sure that you are not changing the property of the DataColumn ReadOnly to True in those column you want to edit.

    I hope this was of some help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    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 …
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 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

    11 Experts available now in Live!

    Get 1:1 Help Now