8 Answers, 1 is accepted
Currently the RadWindowManager's popups (radalert, radprompt and radconfirm) do not support such feature. I logged this as a feature request in our PITS and updated your points.
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.
Anyway you can think of to do this manually?
To elaborate on the case - the three predefined dialogs RadWindowManager offers are not optimized for autosizing, and to make things harder - text does not provide dimensions the dialogs can autosize against, text flows according to its container, wherein the obvious contradiction lies.
Nevertheless, a bit of custom code can create an effect similar to autosizing. The key to this would be to calculate the offsets longer content creates so that you can set them to the dialog. Note that some initial dimensions would be needed in any case, because they are responsible for creating the initial overflow. Here follows an example with explanations:
Note that this will not work with the Lightweight rendermode, because it sets dimensions to different elements
Generally, these dialogs are not designed to autosize, yet you can also consider doing a simple character count check and if it is above a certain threshold - simply use a second set of dimensions that are larger, e.g.:
where these dimensions can be tested for a couple of minutes until the results are satisfactory, the numbers I used here are almost random.
DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!
It got me onto what I think is my final solution. I calculate the size of the text (up to a maximum size) by creating a span in the DOM (with the right css classes) to calculate the size of the text and then setting the size of the window using them. I had to calculate the magic offsets through the debugger and a calculator.
This is an old post, but I thought I would post how I solved the autosizing of the standard dialog boxes of radalert, radconfirm and radprompt. I have shared my solution in the following code library: Auto-size standard dialogs of RadAlert, RadPrompt and RadConfirm.
Can you please share more details on what functionality exactly you are aiming to achieve that the snippets in the thread does not help for?
Then, we would be able to provide some more specific code snippets or suggestions.