NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Phil_J
Posts: 7
0 Kudos
Accepted Solution

XTABLE - I want to initialise the values in XTABLE

Hi

 

I have used the TABLE object in a SUD DIALOG in DiAdem 11 to display calculated values to the user.  That works fine.

 

My boss has now asked me to set the color of cells containing values which are out of specification, to RED.

 

I don't think I can do this with the TABLE object, but I discovered the XTABLE object which seems to allow the properties of individual cells to be set.

 

In theory, this XTABLE object seems very useful, unfortunately, I have been unable to discover from the help file, how to set the values in the cells at run time. I can set a whole column of cells to the same value using the EventColCtrlPreSet(Col, ByRef Cell, IsInputCell) example, but how do I set each individual cell to a different value programatically?

 

Please can you help, as trial and error is getting me nowhere. 

 

Thanks in advance

 

Phil

Active Participant
Twigeater
Posts: 649

Re: XTABLE - I want to initialise the values in XTABLE

Hello Phil!

 

If you switch from TABLE to XTABLE you have to understand the complete different aproach for the same task in this two controls. If you use TABLE you have to fill it with content. XTABLE instead will ask you for every cell value in an event. You just have to set the row count in your code where you filled the TABLE. In the event 'EventValGet' you have to use the row/col numbers to adress your data. The XTABLE will only call the event for the cells visible. If you understand this you can have a look onthe example again to understand how it works.

 

BTW: XTABLE could be named as a 'Virtual Table'

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
Member
Phil_J
Posts: 7
0 Kudos

Re: XTABLE - I want to initialise the values in XTABLE

Thanks very much Matthias

 

I have it working well now.

 

Phil

Trusted Enthusiast
Brad_Turpin
Posts: 2,369

Re: XTABLE - I want to initialise the values in XTABLE

This is for any one else reading this post,

 

I thought you might like to see an example of the callback to fill the XTable:

 

Sub GroupXTable_EventValGet(Row, Col, ByRef Cell, IsInputCell)
Dim This : Set This = GroupXTable
 If Col = 0 Then
   If Row = 0 Then Cell.Text = ...    ' top left cell
   If Row > 0 Then Cell.Text = Row ' row headers
 Elseif Row = 0 Then
   Select Case Col
      Case 1 : Cell.Text = ... ' column 1 header
      Case 2 : Cell.Text = ... ' column 2 header
      Case 3 : Cell.Text = ... ' column 3 header
      Case 4 : Cell.Text = ... ' column 4 header
      Case 5 : Cell.Text = ... ' column 5 header
      Case 6 : Cell.Text = ... ' column 6 header
      Case 7 : Cell.Text = ... ' column 7 header
   End Select ' Col
 Elseif Row <= UBound(Groups) Then
   Select Case Col
      Case 1 : Cell.Text = ... ' column 1 value

      Case 2 : Cell.Text = ... ' column 2 value
      Case 3 : Cell.Text = ... ' column 3 value
      Case 4 : Cell.Text = ... ' column 4 value
      Case 5 : Cell.Text = ... ' column 5 value
      Case 6 : Cell.Text = ... ' column 6 value
      Case 7 : Cell.Text = ... ' column 7 value
    End Select ' Col
  End If

End Sub

 

Bad Turpin

DIAdem Product Support Engineer
National Instruments

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page