[SOLVED] FocusChanging Problem  
       
      Printed From: Codejock Forums
        Category:  Codejock Products
       Forum Name:  Report Control
       Forum Description:  Topics Related to Codejock Report Control
       URL: http://forum.codejock.com/forum_posts.asp?TID=16294
       Printed Date: 04 November 2025 at 8:28am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
      
 
  
      Topic: [SOLVED] FocusChanging Problem
       
      Posted By: jpbro
       Subject: [SOLVED] FocusChanging Problem
       Date Posted: 26 February 2010 at 2:39pm
       
      
        
          
	
Hi,
  I'm trying to configure the ReportControl so that when you click on a Group row, it automatically collapses all other groups and expands only the group that you clicked. Row focus should then switch to the first child of the selected group.
  I've got this working OK, except that it seems the the FocusChanging event doesn't fire for the first group row.
  Here's a sample:
   uploads/20100226_143421_RcFocusChanging.zip - uploads/20100226_143421_RcFocusChanging.zip 
  click each group row to see what I mean.
  Next, I'd like to ensure that one group row is always expanded - the user can shrink/expand group rows by clicking the glyph OR double-clicking the group row. Is there a way to prevent this? I don't see any events that allow us to cancel collapse/expand (but maybe I've just missed it) - or maybe there's a property that I haven't found?
  Thanks. 
  ------------- Product: Xtreme SuitePro (ActiveX) version 16.2.6 Platform: Windows XP - SP3
  Language: Visual Basic 6.0 SP6
  
          | 
         
        
      
 
  Replies: 
       
      Posted By: jpbro
       
      Date Posted: 26 February 2010 at 2:50pm
       
      
        
          
	
Okay for part 2, I've found the RowExpanded event, I'll try working with that. 
  I guess I need another coffee ;) 
  ------------- Product: Xtreme SuitePro (ActiveX) version 16.2.6 Platform: Windows XP - SP3
  Language: Visual Basic 6.0 SP6
  
          | 
         
        
        
       
      
      Posted By: jpbro
       
      Date Posted: 26 February 2010 at 3:04pm
       
      
        
          
	
Okay, RowExpanded does the trick, although I have to use a module level variable to alert the event when it is my code changing the Expanded property versus when the user is doing it.
  A nicer solution would be to have a AllowGroupExpand property that when set to false prevents the user from expanding and collapsing groups (but allows code to do it). It would also hide the +/- glyph so the user wouldn't wonder why it wasn't working.
  Speaking of the +/- glyph, now that I've been able to cancel group expansion/collapse, is there a way to hide the glyph in the group row? 
  ------------- Product: Xtreme SuitePro (ActiveX) version 16.2.6 Platform: Windows XP - SP3
  Language: Visual Basic 6.0 SP6
  
          | 
         
        
        
       
      
      Posted By: jpbro
       
      Date Posted: 26 February 2010 at 6:42pm
       
      
        
          
	
Okay, I'm not sure why FocusChanging wasn't firing for the first row before, but it seems to be firing now. Sorry!
 
  ------------- Product: Xtreme SuitePro (ActiveX) version 16.2.6 Platform: Windows XP - SP3
  Language: Visual Basic 6.0 SP6
  
          | 
         
        
        
       
      
      Posted By: jpbro
       
      Date Posted: 27 February 2010 at 12:20pm
       
      
        
          
	
There's a demo that does most of the initial post requirements available here:  forum_posts.asp?TID=16302 - http://forum.codejock.com/forum_posts.asp?TID=16302 
  ------------- Product: Xtreme SuitePro (ActiveX) version 16.2.6 Platform: Windows XP - SP3
  Language: Visual Basic 6.0 SP6
  
          | 
         
        
        
       
      
     |