-
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?
-
-
Did you ever get this figured out? I'm trying to do something very similar and hoping someone might have some insights.
Thanks
Corinne