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

Resized RadTextBox reverts to original size

3 Answers 105 Views
Input
This is a migrated thread and some comments may be shown as answers.
Bernard Myers
Top achievements
Rank 1
Bernard Myers asked on 10 Aug 2010, 01:16 PM
asp.net Ajax Q2 2010 with IE8

Have existing resizable TextBox which I want to convert to a RadTextBox:-

 

<asp:Panel ID="Pan_dataAdditionalContactInformation" runat="server" Width="410" Height="32" ScrollBars="None"><asp:TextBox runat="server" ID="dataAdditionalContactInformation" Text='<%# Bind("AdditionalContactInformation") %>' TextMode="MultiLine" MaxLength="200" Width="420" ToolTip="Example; Any morning between 10 11am except Wednesday or Saturday" /></asp:Panel

 

 

 

 

<ajaxToolkit:ResizableControlExtender ID="rce_dataAdditionalContactInformation" runat="server" TargetControlID="Pan_dataAdditionalContactInformation" ResizableCssClass="resizingText" HandleCssClass="handleText" MinimumWidth="420" MinimumHeight="32" MaximumWidth="420" MaximumHeight="250" HandleOffsetX="5" HandleOffsetY="5" OnClientResizing="ResizeTextBox" /> 

 

 

 

 

function

 

ResizeTextBox(sender, eventargs) {

 

 

 

var element = sender.get_element();

 

 

element.children[2].style.height = element.style.height;

element.children[2].style.width = element.style.width;

 

return false;

 

 

}

I changed the TextBox to a RadTextBox and use the ResizeRadTextBox function:-

function ResizeRadTextBox(sender, eventargs) {

 

 

 

var element = sender.get_element();

 

 

element.children[2].children[0].style.height = element.style.height;

element.children[2].children[0].style.width = element.style.width;

 

return false;

 

 

}

 


The resizing works, however, as soon as the cursor moves back over the resized RadTextBox it reverts back to its original size.

I have had similar issues where I have been using the wrong method to set the property but can't seem to find a way to set it correctly.

Thanks

 

 

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 10 Aug 2010, 03:24 PM
Hello Bernard,

You should also update

radTB._originalTextBoxCssText

where radTB is the RadTextBox client control instance. For example:

radTB._originalTextBoxCssText = "width:200px;height:20px;";

(note that the string ends with a semi-colon)

Sincerely yours,
Dimo
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
0
Bernard Myers
Top achievements
Rank 1
answered on 13 Aug 2010, 03:14 PM
Still no joy.

It works for TextBoxes using the element.children[2] but is getting reset on RadTextBoxes due to the implementation of the control.

Tried adding element.children[2].children[0]._originalTextBoxCssText = "width:420px;height:200px;"; no change...

I need a handle to the RadTextBox, thought I could use something like :-

var element2 = element.children[2].get_object;

and then set values but  just doesn't seem to work.

The ResizeRadTextBox is a generic function used by numerous objects on the page so I cannot search for the control by name using $find, I need to find it in relation to the sender which is the ajaxToolkit:ResizableControlExtender as I do with the ordinary TextBox.

Can you give me some sample Java to try in the ResizeRadTextBoc function?

Thanks
0
Dimo
Telerik team
answered on 16 Aug 2010, 03:51 PM
Hi Bernard,

There is a huge difference between DOM elements and client control objects. You cannot assign _originalTextBoxCss to a DOM element, as this will not result in anything - you must use the client control object and obtain a reference to it with $find(). If the resize function is generic, you should check whether the currently resized textbox has a client object by checking whether $find("textbox client id") returns null or not.

Regards,
Dimo
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
Tags
Input
Asked by
Bernard Myers
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Bernard Myers
Top achievements
Rank 1
Share this question
or