How to get the position of a TreeView in a web page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vincent90152900
    New Member
    • Jul 2007
    • 50

    How to get the position of a TreeView in a web page?

    Following is my code and I want the Panel1 display beside the TreeView1.

    I found out the ModalPopupExten der has two property, “X”, and “Y”.

    So, I wish I could find out the position of a TreeView1 in a web page and then I can set the “X” and “Y” of the ModalPopupExten der.

    Does anyone know how to do that? Or any suggestion is welcome.

    [HTML] <asp:UpdatePane l ID="UpdatePanel 1" runat="server" UpdateMode="Con ditional">
    <ContentTemplat e>
    <asp:TreeView ID="TreeView1" runat="server" CollapseImageUr l="images/img-icon/icon-book-.gif"
    ExpandImageUrl= "images/img-icon/icon-book+.gif" LeafNodeStyle-ImageUrl="image s/img-icon/icon-book+.gif"
    ExpandDepth="0" OnSelectedNodeC hanged="TreeVie w1_SelectedNode Changed">
    <LeafNodeStyl e ImageUrl="image s/img-icon/icon-book+.gif" />
    </asp:TreeView>
    <asp:Button ID="Button1" runat="server" Text="Button" Style="display: none" />
    <cc1:ModalPopup Extender ID="ModalPopupE xtender1" runat="server" TargetControlID ="Button1"
    PopupControlID= "Panel1">
    </cc1:ModalPopupE xtender>
    <asp:Panel ID="Panel1" runat="server">
    <asp:TreeView ID="TreeView2" runat="server" BackColor="whit e" CollapseImageUr l="images/img-icon/icon-book-.gif"
    ExpandImageUrl= "images/img-icon/icon-book+.gif" LeafNodeStyle-ImageUrl="image s/img-icon/icon-book+.gif"
    ExpandDepth="0" OnSelectedNodeC hanged="TreeVie w2_SelectedNode Changed">
    </asp:TreeView>
    <asp:Button ID="Button2" runat="server" Text="Button" Style="display: none" /></asp:Panel>
    </ContentTemplate >
    </asp:UpdatePanel >
    [/HTML]
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    By position, do you mean finding the position of the node on the screen (ie monitor) ? (if it is so, question yourself)

    if it isint, I havent played with the modal popup, but it is designed to pop in the centre of the screen, javascripts can help you to find the centre of the screen.

    However opening a modal dialog not in the centre would decieve the user, and would complain as they can suspect that other controls have been disabled. (will look like a EBKAC)

    Comment

    • vincent90152900
      New Member
      • Jul 2007
      • 50

      #3
      Originally posted by Shashi Sadasivan
      By position, do you mean finding the position of the node on the screen (ie monitor) ? (if it is so, question yourself)

      if it isint, I havent played with the modal popup, but it is designed to pop in the centre of the screen, javascripts can help you to find the centre of the screen.

      However opening a modal dialog not in the centre would decieve the user, and would complain as they can suspect that other controls have been disabled. (will look like a EBKAC)
      I see.
      Thank you for your suggestion.

      Comment

      Working...