Setting Focus to RadpanelItem not working

5 posts, 0 answers
  1. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 04 Apr 2012 Link to this post

    Hi,

    I want to set focus to a RadPanelItem from server side.

    I have tried the following approach

      RadPanelItem pnlitem1 = (RadPanelItem)TestPanelBar.FindItemByValue("TestPanelItem");
                    pnlitem1.Focus();
                    pnlitem1.Expanded = true;

    But this logic is not working.

    Can any one please help me how to set focus to RadPaneltem through server side.

    Thanks,
    A2H
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 06 Apr 2012 Link to this post

    Hello,

    The Focus() method that you are trying to call on the server side is a method that we inherit from the base class control and it is actually not implemented for the RadPanelBar control. Therefore currently I would suggest that you set focust to the desired PanelItem using the client-side page_Load event and the focus() or set_focus(true) properties. Below you can find more detailed explanations and examples how you can achieve that on the client-side:
    http://www.telerik.com/help/aspnet-ajax/panelbar-client-side-radpanelbaritem.html 

    Regards,
    Kate
    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. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 09 Apr 2012 Link to this post

    HI Kate,

    I have gone through the link which you provided.

    But I am unable to access the Radpanelbar in javascript using '$find" method as given in examples. Its always giving me null values.
    I have a master page also.

    Is there any difference in accessing controls inside a Contenttemplate page.

    Please help me.

    Thanks,
    A2H
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 09 Apr 2012 Link to this post

    Hello,

    Thanks for clarifying that. Yes, there is a difference if you have a master page. The id-s of the controls placed in the content pages changes as well. For instance you can check the following article that explains this in details - Control ID Naming in Content Pages

    Greetings,
    Kate
    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.
  6. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 16 Apr 2012 Link to this post

    Hi Kate,
    Thanks for your Support.
    I achieved the functionality using a method called "ScrollintoView" methods.

    I have to get reference of a control in panel item and set the property.Works like charm :):)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017