Print Page | Close Window

Propertygrid refresh in a pane

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=13666
Printed Date: 18 May 2024 at 2:36pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Propertygrid refresh in a pane
Posted By: ideafix
Subject: Propertygrid refresh in a pane
Date Posted: 12 March 2009 at 6:49pm
Hi to everyone!

I have a question that I cannot find the solution.

I am developing an MDI application that uses Docking panes. In pane A I have a treeview, and in another pane (pane B) I have a property grid (version 12).

When I click in a tree node, I clear the property grid, and add some properties. What happens?

When I add in form_load (in frmPropertyGrid) the properies appears, but when I click in a tree node, I add properties, but the PropertyGrid appears blank.

Does anyone can help me?

Thanks

Ricardo



Replies:
Posted By: Aaron
Date Posted: 13 March 2009 at 8:09am
Hi,
 
Can you show me what you do? Or just upload test project so I can look into it.
 
Thanks
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: ideafix
Date Posted: 13 March 2009 at 9:41am

Hi Aaron

The code is very simple!

I have been using the example of GUISample.vbp.

I have created a public function that updates de property grid...
 
This code is in frmpropertygrid
 
Public Sub CarregaGrelhaDados(ByVal strNomeTabela As String, Optional ByVal strDados As Variant)
Dim category As PropertyGridItem
Dim item As PropertyGridItem
 
  frmPropertyGrid.wndPropertyGrid.ToolTipContext.Style = xtpToolTipLuna
  frmPropertyGrid.wndPropertyGrid.ShowInplaceButtonsAlways = False
  frmPropertyGrid.wndPropertyGrid.Categories.Clear
  
  Set category = frmPropertyGrid.wndPropertyGrid.AddCategory(objLangDef(51).strString)
  For i = 1 To UBound(objTipoDados)
  arrTipoDados = Split(objTipoDados(i), "|")
  arrToolTips = Split(objToolTips(i), "|")
  Select Case arrTipoDados(2)
    Case "bigint": IntTipo = PropertyItemNumber
    Case "int": IntTipo = PropertyItemNumber
    Case "varchar": IntTipo = PropertyItemString
  End Select
  If IntTipo = PropertyItemNumber Then
    strAux = arrTipoDados(1)
    Set item = category.AddChildItem(PropertyItemNumber, strAux, 10)
  Else
    strAux = arrTipoDados(1)
    Set item = category.AddChildItem(PropertyItemString, strAux, "100; 100")
  End If
  If arrTipoDados(4) = "0" Then
    item.ReadOnly = True
  Else
    item.ReadOnly = False
  End If
  item.ToolTip = arrToolTips(1)
  item.Expanded = True
  category.Expanded = True
  Next i
End Function
 
Thanks!
 
 


Posted By: Aaron
Date Posted: 14 March 2009 at 11:12am
Hi,
 
Form frmPropertyGrid is created (in DockingPanes attach event) as a new instance. It seems you can't have a reference to that form with MDI. You can make frmPropertyGrid public but you get an error: Only one MDI form allowed. 
 
 
This will work with MDI, just test it and:
  1. Remove Dim frmPropertyGrid As frmPropertyGrid global variable in frmMain
  2. In DockingPaneManager_AttachPane event:
            Case ID_PANE_PROPERTIES:
                If frmPropertyGrid Is Nothing Then
                    Set frmPropertyGrid = frmPropertyGrid
                End If
                Item.Handle = frmPropertyGrid.hwnd
I don't know how to get around this in MDI... I have simular code with SDI and I can make calls in other forms. I don't know why I can't with MDI, maybe you know..... why?
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: ideafix
Date Posted: 14 March 2009 at 4:34pm
Yeap!

It work, Aaron! I have removed the code.

Finally it works!

Thanks a lot!

Ricardo


Posted By: aridheva
Date Posted: 21 May 2009 at 1:55am


Good Job




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net