DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

xTable - change cell colour

Solved!
Go to solution

Hello,

In my xTable, this sub will change the colour of the dialog permanently when I change a cell entry:-

 

Sub XTable1_EventValSet(ByRef This, Row, Col, ByRef Cell) 'Created Event Handler

If Row > 0 And Col > 0 Then

Data.GetChannel(Col).Values(Row) = Val(Eval(Cell.Text))

Dialog.Color = vbcyan ' this works

End If

 

But, how can I change the background colour of just the changed cell permanently?

I can only get the cell colour to change temporarily using the examples from Diadem help (XTable1_EventDefaultColCtrlPreset and Cell.ForeColor)......

 

Any help is appreciated.

Thank you.

0 Kudos
Message 1 of 5
(2,250 Views)

Hello mrme,

 

did you try this:

Sub XTable1_EventValSet(ByRef This, Row, Col, ByRef Cell) 'Created Event Handler

If Row > 0 And Col > 0 Then
  Data.GetChannel(Col).Values(Row) = Val(Eval(Cell.Text))
  ' Dialog.Color = vbcyan ' this works
  Cell.BackColor = = vbcyan ' this works
End If

End Sub

Greetings

Walter

0 Kudos
Message 2 of 5
(2,219 Views)

Hello Walter,

 

Thanks for the response.   Yes, I have tried it, but no success. Neither Cell.BackColor nor Cell.ForeColor work.  There is no error message.  Xtable1.Refresh has no effect either.

 

I forgot to provide the version of Diadem  - it is 2018, 18.0.0f7097 (64 bit).

 

Thank you,

Thomas

 

0 Kudos
Message 3 of 5
(2,217 Views)
Solution
Accepted by topic author mrme

Hello Thomas,

 

Colors can only be set in the ...Get event. I've attached an example SUD.

 

Greetings

Walter

0 Kudos
Message 4 of 5
(2,183 Views)

Hello Walter,

Many thanks for the reply and example.

Thomas

0 Kudos
Message 5 of 5
(2,171 Views)