I’ve currently got a CollapsingRecordNode inside a GoPalette, and I want to dynamically resize the GoPalette depending on the height of the CollapsingRecordNode.
However when I collapse the CollapsingRecordNode, the height property remains the same. Is there any way to access the collapsed height of the node?
Thanks in advance.
The height should be changing… it does if I use the Demo1 properties window. (note the properties window in the sample doesn’t update by itself, you have to select the node a second time to get it to refresh)
Hi Jake,
Yes you’re right, I’ve found that the height of the CollapsingRecordNode changes…but how can I grow/shrink the GoPalette each time the CollapsingRecordNode is collapsed/expanded, without doing a full postback (I have NoPost=“true” on the GoPalette).
Thanks again.
Changes in GoView or GoPalette size in GoWeb requires the change be made in javascript on the client side. (see Dynamic Resizing of Webforms)
Yes, we have worked with GoViewDataRenderer before…but doesn’t that apply only to a GoView?
Is there a way to apply that or something similar to a GoPalette?
GoPalette inherits from GoView.
Thanks Walter,
At the moment inside my GoPalette I have the CollapsingRecordNode class containing the CollapsingRecordNodeItemList class (as per Demo1). In the Collapse() method of the CollapsingRecordNodeItemList class I was attempting to resize the Document object (in bold) which I assumed was the GoPalette?:
Public Overridable Sub Collapse() Implements IGoCollapsible.Collapse
Try
If Not Me.IsExpanded Then Return
Dim hdr As GoObject = Me.Header
For Each obj As GoObject In Me
If Not obj Is hdr Then 'continue
Dim list As CollapsingRecordNodeItemList = Nothing
If TypeOf obj Is CollapsingRecordNodeItemList Then list = CType(obj, CollapsingRecordNodeItemList)
If Not list Is Nothing Then
list.WasExpanded = list.IsExpanded
list.Collapse()
End If
obj.Visible = False
obj.Printable = False
End If
Next
myIsExpanded = False
Changed(ChangedIsExpanded, 0, True, NullRect, 0, False, NullRect)
LayoutChildren(Nothing)
Me.Document.Size = New System.Drawing.SizeF(Me.Document.Size.Width, Me.Parent.Height)
Catch ex As Exception
Throw New Exception(mcstrMOD & “.Collapse()”, ex)
End Try
End Sub
A better way to set the size of the Document is to do
Me.Document.Bounds = Me.Document.ComputeBounds()
that will compute the size of the document that encloses the GoObjects within it.
Thanks Jake,
Although this still requires a postback to work…
Ultimately we’d like the GoPalette to resize so that its height is the same height as the CollapsingRecordNode within it, remembering this is the only item within this GoPalette.
The reason we are trying to do this is because we have the GoPalette within a fixed size
We have managed to resize the GoPalette in the Collapse method of the CollapsingRecordNodeItemList class (code above), which after a postback gives us the result that we want. Unfortunately this is a very ugly way of achieving our goal.
What we’d like to do is resize the GoPalette in JavaScript and thus removing the requirement for a postback (I assume this is what Walter was eluding to when he said another round trip?).
Thanks again…
The scrollbar stays because the document will only grow, not shrink… unless you set the Bounds like I showed in my previous post.
[QUOTE=Jake]The scrollbar stays because the document will only grow, not shrink… unless you set the Bounds like I showed in my previous post. [/quote]I apologise if I’m wrong, but it appears as though you haven’t even been reading Dave’s posts - disappointing…
I’m working on some sample code for Dave…