This is a migrated thread and some comments may be shown as answers.

Can I have the button inside the textbox in a RadTextBox

4 Answers 530 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 2
Jose asked on 20 Feb 2009, 05:38 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 23 Feb 2009, 10:48 AM
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.
0
Jose
Top achievements
Rank 2
answered on 23 Feb 2009, 02:57 PM
Thanks Dimo. Works absolutely nice!!

Jose Guay
0
TechSavvySam
Top achievements
Rank 1
answered on 13 Apr 2012, 03:25 AM

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.

0
Richard
Top achievements
Rank 1
answered on 17 Apr 2012, 03:39 PM
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.
Tags
Input
Asked by
Jose
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Jose
Top achievements
Rank 2
TechSavvySam
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or