Notifications
Clear all

[Closed] dotNet ListView column display issue

I am getting a display glitch with dotNet ListView columns. When I create my dialog and the listview is created and initialized, all columns but the last one to be added is greyed out and not displaying any text.

Once you click the column, collapse and expand the rollout, minimize and restore the dialog, or any other methods of refreshing the dialog’s display the column is displayed as normal.

I tried the methods .Focus() and .Refresh() at the end of my ListView’s initialization function. All this did was grey out the final column which was previously not having the issue.

Any help is appreciated.

4 Replies
 PEN

I have seen this with the listsviews that I have created as well Mat. Pinky Mod has this issue as well that you are using. Have you seen it there as well?

Have you tried Invalidate() method ?
Can you post a sample code showing this strange behaviour ?

SceneListView example from the reference doesn’t have this display glitch.

Hi Paul, I hadn’t noticed it with the PinkyMod but I just went back and tested it out and did actually run into it with the attributes subrollout.

Hi Yannick, I just tried the Invalidate() method followed by a Focus() and it fixed the issue. Here is a sample code anyways. It seems that the problem is only with subRollouts.

	
  	fn initializeListView lv columns = -- Initializes the list view dot net control.  Variable columnNames needs to be an array of strings that specify what the names of the columns will be.  This also determines how many columns will exist.
  	(
  		lv.gridLines = true -- Display the grid lines in the list view.
  		lv.View = (dotNetClass "System.Windows.Forms.View").Details
  		lv.fullRowSelect = true -- Allows the user to select the rows in the list view.
  		lv.multiSelect = true  
  		for c in columns do lv.Columns.add c ((400 / columns.count) * 0.99)
  	)
  	
  	if classOf main_roll == rolloutclass then destroyDialog main_roll
  	rollout main_roll "Main Rollout" width:400
  	(
  		subrollout main_sub height:materialManager_roll.height
  	)
  	rollout sub_roll "Main Rollout" width:400
  	(
  		group "Browser"
  		(
  			dotNetControl browser_lv "System.Windows.Forms.ListView" width:380 height:400
  		)
  		
  		on sub_roll open do initializeListView browser_lv #("Name", "Class", "Compatible With Renderer")
  	)
  
  	createDialog main_roll
  	AddSubRollout main_roll.main_sub sub_roll
  	-- createDialog sub_roll

Running this whole chunk will add the rollout that has the listview to a subrollout and give the error. Uncomment the last line and comment the two previous so the rollout with the listview is created directly and the error won’t happen.

Anyways, problem solved. Thanks again Yannick.

1 Reply
(@ypuech)
Joined: 11 months ago

Posts: 0

Ah ok, I remember now I noticed this behaviour when I used a .NET control in a scripted utility; it wasn’t refreshed correctly.