javascript to set height does not appear to be recognized from a dynamically built step in the radwizard
I am using this in the aspx body (taken from telerik forum)
<script type="text/javascript">
function setHeight(sender, args) {
window.setTimeout(function () {
sender._textBoxElement.style.height = "";
window.setTimeout(function () {
sender._textBoxElement.style.height = sender._textBoxElement.scrollHeight + "px";
sender._originalTextBoxCssText += "height: " + sender._textBoxElement.style.height + ";";
}, 1);
}, 1);
}
</script>
and using the following to build the step in the wizard
case 7:
e.RadWizardStep.Controls.Add(new LiteralControl("<div class='row inputwrapper'><div class='col-md-12 text-center'>"));
var questionsourceScript = db.QuestionSources.Where(q => q.QuestionId == question.QuestionId).Where(q => q.MarkDelete == false).OrderBy(q => q.DisplayOrder).First();
//var controlIdScript = string.Format("SID{0}QID{1}QSID{2}", question.SurveyID, questionsourceScript.QuestionId, questionsourceScript.QuestionSourceId);
RadTextBox scriptbox = new RadTextBox();
scriptbox.Skin = "MetroTouch";
scriptbox.Text = questionsourceScript.Value;
scriptbox.AutoPostBack = false;
scriptbox.ID = string.Format("RBLSID{0}", Guid.NewGuid().ToString());
//scriptbox.InputType = Html5InputType.Text;
scriptbox.TextMode = InputMode.MultiLine;
scriptbox.Width = Unit.Percentage(100);
scriptbox.ReadOnly = true;
//scriptbox.Rows = 12;
scriptbox.ClientEvents.OnLoad = "setHeight";
scriptbox.ClientEvents.OnValueChanged = "setHeight";
e.RadWizardStep.Controls.Add(scriptbox);
e.RadWizardStep.Controls.Add(new LiteralControl("</div></div>"));
break;
when displaying the step in the wizard, the textbox displays like there are 0 lines and there should be 13
Any suggestions?