D
David Fúnez
Hi;
I'm working with Component One FlexGrid DataGrid, i've added a calculated
field [qty*price] to the DataGrid, when i press the Save Button an error
message is displayed "Cannot Change read Only Property For the Expression
Column" i press Enter and the Data is Saved even the Message "Data is Saved"
is not shown.
So i don't understand why it launches that error message if it saves the
data anyway.
*** The Form Load Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Here i add the column with the calculated field
DsDeta1.Tables(0).Columns.Add("Sub Total", GetType(Double), "qty *
price")
daDeta.Fill(DsDeta1)
Flex.Cols(7).Format = "c"
Flex.Subtotal(AggregateEnum.Sum, 0, 0, 7, "Total")
Flex.AllowEditing = False
End Sub
**** And this is the code for the Save button:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Try
BindingContext(DsDeta1.Tables(0)).CancelCurrentEdit()
daDeta.Update(DsDeta1.Tables(0))
DsDeta1.Tables(0).AcceptChanges()
MsgBox("Data is Saved")
Flex.AllowEditing = False
Catch ex As Exception
MsgBox("Error :" & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Any help.... Thanks on advance
I'm working with Component One FlexGrid DataGrid, i've added a calculated
field [qty*price] to the DataGrid, when i press the Save Button an error
message is displayed "Cannot Change read Only Property For the Expression
Column" i press Enter and the Data is Saved even the Message "Data is Saved"
is not shown.
So i don't understand why it launches that error message if it saves the
data anyway.
*** The Form Load Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Here i add the column with the calculated field
DsDeta1.Tables(0).Columns.Add("Sub Total", GetType(Double), "qty *
price")
daDeta.Fill(DsDeta1)
Flex.Cols(7).Format = "c"
Flex.Subtotal(AggregateEnum.Sum, 0, 0, 7, "Total")
Flex.AllowEditing = False
End Sub
**** And this is the code for the Save button:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Try
BindingContext(DsDeta1.Tables(0)).CancelCurrentEdit()
daDeta.Update(DsDeta1.Tables(0))
DsDeta1.Tables(0).AcceptChanges()
MsgBox("Data is Saved")
Flex.AllowEditing = False
Catch ex As Exception
MsgBox("Error :" & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Any help.... Thanks on advance