Results 1 to 3 of 3

Thread: Datagrid readonly

  1. #1

    Thread Starter
    Junior Member ost's Avatar
    Join Date
    Jan 2004
    Posts
    19

    Datagrid readonly

    Hi

    I have a datagrid that displays data that users can edit.

    The users however shall not be able to add a new row to the grid and I don't want an empty row at the end of the grid.

    If i make the grid readonly the empty row at the end disappears but of course now the users can'r edit the data.

    If i make the grid editable i get an empty row at the end.

    im using a tablestyle that looks like this.



    Code:
            Dim tableStyle As New DataGridTableStyle
            tableStyle.MappingName = "MobileNoProducts"
            tableStyle.AllowSorting = False
            
            Dim column As New FormattableTextBoxColumn()
            column.MappingName = "Productname"
            column.HeaderText = "Produktnavn"
            column.Width = 159
            column.ReadOnly() = True
            tableStyle.GridColumnStyles.Add(column)
    
            Dim AnswerCol As New ClickableBooleanColumn()
            AnswerCol.MappingName = "Yes"
            AnswerCol.HeaderText = "Ja"
            AnswerCol.Width = 30
            'turn off tristate
            AnswerCol.AllowNull = False
            tableStyle.GridColumnStyles.Add(AnswerCol)
    
            AnswerCol = New ClickableBooleanColumn()
            AnswerCol.MappingName = "No"
            AnswerCol.HeaderText = "Nej"
            AnswerCol.Width = 30
            'turn off tristate
            AnswerCol.AllowNull = False
            tableStyle.GridColumnStyles.Add(AnswerCol)
    
            AnswerCol = New ClickableBooleanColumn()
            AnswerCol.MappingName = "Error"
            AnswerCol.HeaderText = "Fejl"
            AnswerCol.Width = 30
            'turn off tristate
            AnswerCol.AllowNull = False
            tableStyle.GridColumnStyles.Add(AnswerCol)
    
            Me.MobilNoDataGrid.TableStyles.Add(tableStyle)
    any ideas?

  2. #2

    Thread Starter
    Junior Member ost's Avatar
    Join Date
    Jan 2004
    Posts
    19
    !BUMP!

  3. #3
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    Did you ever get this figured out? I'm trying to do something very similar and hoping someone might have some insights.

    Thanks
    Corinne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width