Hi Telerik,
I have a RadWindow of a certain size. When the RadWindow is first loaded I call AdjustRadWindow to set the window size. In addition, the window adjusts fine on a RadDateTimePicker's OnPopupOpening and OnPopupClosing events.
I am struggling to get this to work when the user interacts with a RadComboBox. The RadComboBox hides elements on the RadWindow and I would like to resize the window after they're hidden.
If I place an alert inside of OnClientSelectedIndexChanged then, after I close the alert, AdjustRadWindow seems to work properly. The problem is that the controls aren't disappearing fast enough from the screen, even with two time-outs.
I believe the issue may be related to this -- http://www.telerik.com/community/forums/aspnet-ajax/ajax/slow-ajax-response-wondering-if-i-can-do-something-to-improve.aspx
Any suggestions? Solutions?
Thanks
Sean
I have a RadWindow of a certain size. When the RadWindow is first loaded I call AdjustRadWindow to set the window size. In addition, the window adjusts fine on a RadDateTimePicker's OnPopupOpening and OnPopupClosing events.
I am struggling to get this to work when the user interacts with a RadComboBox. The RadComboBox hides elements on the RadWindow and I would like to resize the window after they're hidden.
protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e){ SetWindowState(RadComboBox1.SelectedValue);}private void SetWindowState(string currentSelection){ if (string.Compare(currentSelection, Charts.LineChart.ToString()) == 0) { RadDateTimePicker2.Visible = true; Label2.Visible = true; CheckBox3.Visible = true; } else if (string.Compare(currentSelection, Charts.PieChart.ToString()) == 0) { RadDateTimePicker2.Visible = false; Label2.Visible = false; CheckBox3.Visible = false; } else { Debug.Assert(false, "Unhandled chart type in RadSettings"); }}function OnClientSelectedIndexChanged(sender, eventArgs) { setTimeout(function () { AdjustRadWindow(); }, 500);}function AdjustRadWindow() { var oWindow = GetRadWindow(); setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);}//fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layoutfunction ChromeSafariFix(oWindow) { var iframe = oWindow.get_contentFrame(); var body = iframe.contentWindow.document.body; setTimeout(function () { var height = body.scrollHeight; var width = body.scrollWidth; var iframeBounds = $telerik.getBounds(iframe); var heightDelta = height - iframeBounds.height; var widthDelta = width - iframeBounds.width; if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta); if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta); oWindow.center(); }, 310);}If I place an alert inside of OnClientSelectedIndexChanged then, after I close the alert, AdjustRadWindow seems to work properly. The problem is that the controls aren't disappearing fast enough from the screen, even with two time-outs.
I believe the issue may be related to this -- http://www.telerik.com/community/forums/aspnet-ajax/ajax/slow-ajax-response-wondering-if-i-can-do-something-to-improve.aspx
Any suggestions? Solutions?
Thanks
Sean