not able to set focus on treeview, when treeview is inside radpanelbar, specific to IE

3 posts, 0 answers
  1. mirang
    mirang avatar
    115 posts
    Member since:
    Aug 2010

    Posted 12 Apr 2012 Link to this post

    I am not able to set focus on the treeview when the page loads when the treeview is inside a radpanelbar. Following is the code for the same. I am not sure where I might be going wrong. Can you please guide me through.

     <script language="javascript" type="text/javascript">
            function OnPanelBarClientLoad(sender, args) {
                var panelBar = $find("<%= NavigationPanelBar.ClientID %>");
                var panelItem = panelBar.findItemByText("Browse");
                var treeView = panelItem.findControl("archiveTree");
                treeView._element.focus();
            }
    </script>
    <telerik:RadPanelBar TabIndex="1" OnClientLoad="OnPanelBarClientLoad" ID="NavigationPanelBar" Style="overflow: auto" runat="server"
                AccessKey="P" ExpandMode="MultipleExpandedItems" Skin="Metro" EnableEmbeddedSkins="false">
                <ExpandAnimation Duration="0" />
                <CollapseAnimation Duration="0" />
                <Items>
                    <telerik:RadPanelItem TabIndex="2" Expanded="true" Text="Browse">
                        <Items>
                            <telerik:RadPanelItem>
                                <ItemTemplate>
                                    <div>
                                        <telerik:RadTreeView ID="archiveTree" TabIndex="3" runat="server">
                                        <Nodes>
                                            <telerik:RadTreeNode Text="First">
                                                <Nodes>
                                                    <telerik:RadTreeNode Text="First First" />
                                                </Nodes>
                                            </telerik:RadTreeNode>
                                        </Nodes>
                                    </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem Expanded="true" TabIndex="4" Text="Browse">
                        <Items>
                            <telerik:RadPanelItem>
                                <ItemTemplate>
                                    <div id="archivesPanel">
                                    </div>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 18 Apr 2012 Link to this post

    Hi Mirang,

     
    I will recommend you to focus the div of RadTreeView by using jQuery as in the sample attached.

    Hope this will be helpful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mirang
    mirang avatar
    115 posts
    Member since:
    Aug 2010

    Posted 18 Apr 2012 Link to this post

    Thanks a lot for the solution. It worked.
Back to Top