• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Making an entire column editable

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?
0
johnqtr
Asked:
johnqtr
1 Solution
 
Fernando SotoCommented:
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
        dt.Columns.Add(dc)

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

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
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now