PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


phGantTimePackage FAQ 10147


How can I make a tree node selected in phGantX? Please note that this article refers to the phGantTimePackage
Jump to article- 2005-04-14 10:59:00 - Email plexityHide

Question

How can I make a tree node selected, I use 'Selected = True' but it's not doing anything.

Example here:

Private Sub phGantX_OnDblClickGantArea(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_GantTime)
  Dim phActivity As IphDataEntity_Tree2
  'open / close tree nodes
  If Not (theDataEntity Is Nothing) Then
    Set phActivity = theDataEntity.Row.TreeNode
    phActivity.Expanded = True
    phActivity.Selected = True '<--No tree row highlight ?
  End If
End Sub

Answer

The Selected property works if you use the tree (not recommended, deprecated), but you use the grid (good choice), and then the selection is per cell rather than per row.

To select an individual cell you call IphGantX3.SetGridCellSelected(x,y,true/false). But the grid handles multi-select, so there is a difference between select and focus.
You probably want to set the focused cell, and you do this with the properties IphGantX3.GridCellFocusedX and IphGantX3.GridCellFocusedY.

So in the case above you would go:

Private Sub phGantX_OnDblClickGantArea(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_GantTime)
  Dim phActivity As IphDataEntity_Tree2
  'open / close tree nodes
  If Not (theDataEntity Is Nothing) Then
    Set phActivity = theDataEntity.Row.TreeNode
    phActivity.Expanded = True

    theGant.GridCellFocusedX=0
    theGant.GridCellFocusedY=theDataEntity.Row.TreeNode.GridRowIndex

  End If
End Sub

 

Google
WWW plexityHide phGantTimePackage FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ GTP.NET.SL and WPF

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...




/" class="blk">PlexityHide.com
Grastensvagen 24, S-163 45 Spanga Sweden
E-mail: support@plexityhide.com