Hi,
I have a GridControl with three columns: A, B C
When the column C value is 1, then column B value must be 0, and must change his format.
It is solved by the following code in PrepareViewStyleInfo event:
If e.RowIndex > 0 And e.ColIndex = 2 Then
GridControl1.IgnoreReadOnly = True
If GridControl1(e.RowIndex, 3).FormattedText = "1" Then
e.Style.Text = 0
e.Style.ReadOnly = True
e.Style.BackColor = Color.AliceBlue
ElseIf GridControl1(e.RowIndex, 3).FormattedText = "0" Then
e.Style.ReadOnly = False
e.Style.BackColor = Color.White
End If
GridControl1.IgnoreReadOnly = False
End If
Nevertheless, though the value of B changes 0, the calculations on B do not change.
I add a sample project. (VB 2005)
Example:
1. In the combo, Choose Vegetables
2. Type 1 Tomatoes, 2 Onions (b2=2, b3=2)
3 Now, in the combo, change vegetables for fruits, (b2 and b3 changes to 0)
4 Type 2 apples, 3 pears (b4=2, b5=3)
5 Why total is 8 instead of 5?
How I can change this behavior?
I use Essential Studio 4.2.0.37
Best regards,
P.D. I do not speak english, forgive the mistakes of translation
Prueba.zip