Can I have the button inside the textbox in a RadTextBox

5 posts, 1 answers
  1. Jose
    Jose avatar
    49 posts
    Member since:
    Aug 2008

    Posted 20 Feb 2009 Link to this post

    Hi all.

    Just a simple question. Can I have the button inside the textbox in a RadTextBox? I need that to comply with the design of the website, I can't have it to the left or right of the textbox part.

    Thanks.
    Jose Guay
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 23 Feb 2009 Link to this post

    Hi Jose,

    Generally, you cannot have anything inside a textbox except plain text, but you can make the button look like as if it is in the textbox. Here is a simple example:


    <%@ Page Language="C#" %>  
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>  
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
      
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />  
    <title>RadControls for ASP.NET AJAX</title>  
    <style type="text/css">  
      
    .MyTextBoxWrapper  
    {  
        border:1px solid blue;  
        backgrond:#ccf;  
        width:150px;  
        height:20px;  
    }  
      
    .MyTextBox  
    {  
        border:0;  
        background:transparent;  
        color:#006;  
    }  
      
    .MyImageButton  
    {  
        vertical-align:middle;  
    }  
      
    </style>  
    </head>  
    <body>  
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server" />  
      
    <div class="MyTextBoxWrapper">  
    <telerik:RadTextBox ID="RadTextBox1" runat="server" Skin="" CssClass="MyTextBox" Width="120px" />  
    <asp:ImageButton ID="ImageButton1" runat="server" CssClass="MyImageButton" ImageUrl="http://www.telerik.com/help/aspnet-ajax/App_Themes/Default/TreeView/file.gif" ToolTip="ImageButton" />  
    </div>  
      
    </form>  
    </body>  
    </html>  


    Regards,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jose
    Jose avatar
    49 posts
    Member since:
    Aug 2008

    Posted 23 Feb 2009 Link to this post

    Thanks Dimo. Works absolutely nice!!

    Jose Guay
  5. TechSavvySam
    TechSavvySam avatar
    38 posts
    Member since:
    Jul 2009

    Posted 12 Apr 2012 Link to this post

    Hey, this is close to what I'm looking for but how would you make it so the style of the surrounding div is identical to what a RadTextBox would have been?  Said another way, how do you incorporate the Telerik Skins into this solution?

    Actually exactly what I'm trying to do is this:  I want a RadTextBox with a RadSpell button "inside" of it and I want the all of the styles on the wrapping div to act just like a RadTextBox.

  6. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 17 Apr 2012 Link to this post

    Sam:

    Have you seen this online demo? If I understand your requirement, this is very close:
    Spell/Inside a User Control

    Alternatively, can you consider using a minimal version of the RadEditor, with the RadSpell functionality enabled, in place of the textbox,

    Hope this helps.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017