Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - Propertygrid refresh in a pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Propertygrid refresh in a pane

 Post Reply Post Reply
Author
Message
ideafix View Drop Down
Newbie
Newbie
Avatar

Joined: 12 March 2009
Location: Portugal
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ideafix Quote  Post ReplyReply Direct Link To This Post Topic: Propertygrid refresh in a pane
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
ideafix View Drop Down
Newbie
Newbie
Avatar

Joined: 12 March 2009
Location: Portugal
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ideafix Quote  Post ReplyReply Direct Link To This Post 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!
 
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
ideafix View Drop Down
Newbie
Newbie
Avatar

Joined: 12 March 2009
Location: Portugal
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ideafix Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2009 at 4:34pm
Yeap!

It work, Aaron! I have removed the code.

Finally it works!

Thanks a lot!

Ricardo
Back to Top
aridheva View Drop Down
Newbie
Newbie
Avatar

Joined: 21 May 2009
Location: Indonesia
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote aridheva Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2009 at 1:55am


Good Job

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.