RadAlert - How do position at the top of the page?

5 posts, 0 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 01 Sep 2010 Link to this post

    Hi..
    I'm using the following code. WHen a user clicks a Save button at the bottom of the page.

     

     

    string scriptstring = "radalert('Information Added!',300, 100);";

     

     

     

    ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);

     


    How can I position the RadAlert at the top of the page? So the user can begin to enter a new record? I tired

    txtLastName.Focus()

    but it doesn't seem to work...

    thanks
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Sep 2010 Link to this post

    Hi Jon,

    I assume you want to focus a textbox after the radalert's OK button is clicked. If this is so, you could use the add_close() method of the object to execute your focusing code:

    function alertFn()
    {
        var oWnd = radalert("alertmsg");
        oWnd.add_close(function ()
        {
            $get("txt1").focus();
        });
    }


    Greetings,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 07 Sep 2010 Link to this post

    I'm getting object is null .... I know the name of the Rad Combo Box IS cmbPREFIX.. any ideas ?  thanks

    function

     

     

    alertSaved() {

     

     

     

    var oWnd = radalert("Information Added!",300,100, "TRU");

     

    oWnd.add_close(

     

    function () {

     

    $get(

     

    "cmbPREFIX").focus();                      <--- ERROR HERE

     

    });

    }


  4. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 07 Sep 2010 Link to this post

    I got it working.. BUT it does not set the focus on the RadCombo... Looks like nothing gets focus

     

     

    function alertSaved() {

     

     

     

    var oWnd = radalert("Constituent Information Added!",300,100, "TRU");

     

    oWnd.add_close(

     

    function () {

     

    document.getElementById(

     

    '<%= cmbPREFIX.ClientID %>').focus()

     

     

    });

    }


    HELP
  5. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 07 Sep 2010 Link to this post

    I'm going open a ticket..  need this fixed  asap.. thanks
Back to Top