if (saParam[1] == 'Always')
{
AlwaysRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
true;
InitiateConnectionCheckBox.Enabled =
false;
WaitRadNumericTextBox.Enabled =
false;
DelayRadNumericTextBox.Enabled =
false;
}
else if (saParam[1] == 'Any')
{
RunIfAnyRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
true;
InitiateConnectionCheckBox.Enabled =
false;
WaitRadNumericTextBox.Enabled =
true;
DelayRadNumericTextBox.Enabled =
true;
}
else if (saParam[1] == 'Specific')
{
SpecificRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
false;
InitiateConnectionCheckBox.Enabled =
true;
WaitRadNumericTextBox.Enabled =
true;
DelayRadNumericTextBox.Enabled =
true;
}
javascript:
function
DisableDelayWaitControls( bDisabled )
{
var ntbDelay = $find( "CriteriaDelayRadNumericTextBox" );
var ntbDelayUp = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinUpButton" );
var ntbDelayDown = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinDownButton" );
var ntbWait = $find( "CriteriaWaitRadNumericTextBox" );
var ntbWaitUp = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinUpButton");
var ntbWaitDown = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinDownButton" );
ntbDelay.disabled = bDisabled;
ntbWait.disabled = bDisabled;
ntbDelay._textBoxElement.disabled = bDisabled;
ntbDelayUp.disabled = bDisabled;
ntbDelayDown.disabled = bDisabled;
ntbWait._textBoxElement.disabled = bDisabled;
ntbWaitUp.disabled = bDisabled;
ntbWaitDown.disabled = bDisabled;
}
If the 'Always' code branch is executed I can never enable my controls in javascript.?????
var
tbConnectionName = document.getElementById( "ConnectionNameTextBox" );
var cbInitiate = document.getElementById( "InitiateConnectionCheckBox" );
var tb = $telerik.toTextBox( tbConnectionName );
//tb._textBoxElement.readOnly = true;
var e = tb.get_element;
tbConnectionName.readonly =
true;
cbInitiate.disabled = bDisabled;
Disabling the cbInitiate object works fine, but none of my attempts to set readonly
on the tbConnectionName object have been successful.
BTW here is the corresponding HTML:
<div style="width:85%; float:right;">
<telerik:RadTextBox
ID="ConnectionNameTextBox"
ClientIDMode="Static"
MaxLength="80"
runat="server"
Width="300px" TabIndex="4" />
</div>
<div style="width:85%; float:right;">
<asp:CheckBox ID="InitiateConnectionCheckBox" runat="server"
AutoPostBack="True"
AccessKey="I"
ClientIDMode="Static"
OnCheckedChanged="InitiateConnectionCheckBoxClicked"
TabIndex="5" Text="Initiate a connection if not already connected" />
</div>
Right now I am considering maing an Ajax request in my onclick event and setting
the property in server side code. We can set ReadOnly quite successfully all over the place in server side code. Doing this seems excessive though.
Any help greatly appreaciated.
OnClientClose="OnClientclose"<asp:ImageButton ID="imbBTN1" runat="server" AlternateText="Close" OnClientClick="javascript:top.document.location.href='./closing.aspx';return false;" ImageUrl="~/Images/Approve.gif" /><telerik:RadDatePicker ID="radDatePickerStartDate1" runat="server" Culture="en-US" EnableTyping="False" Enabled="False" ZIndex="1000" Skin="Outlook"> <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" Skin="Outlook"> </Calendar> <DateInput ID="DateInput1" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" ReadOnly="True"> </DateInput> <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton> </telerik:RadDatePicker><telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="True" Title="Archive Progress..." ShowContentDuringLoad="False" ReloadOnShow="True" VisibleStatusbar="False" EnableViewState="False" OnClientClose="OnClientclose"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" Height="600px" Modal="True" VisibleOnPageLoad="false" ReloadOnShow="True" ShowContentDuringLoad="False" Style="display: none;" Title="Archive Progress..." VisibleStatusbar="False" Width="800px" KeepInScreenBounds="True" EnableViewState="false" Behavior="Move" Behaviors="Move" Skin="Outlook"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager><script type="text/jscript" language="javascript"> /********************************************************** Window Events **********************************************************/ function OnClientclose(sender, eventArgs) { window.location = "./closing.aspx"; } </script>I have an ajaxified textbox in an ajaxified RadGrid.
When I update text in the textbox and click on the save icon in an editable row the server side code gets executed correctly but the ui is not updated (repainted). The row is still in edit mode and there is no save message.
NOTE: The textbox’s and the save buttons ajax postback occurs at the same time. This is because the textbox has not lost focus until the save button has been clicked. This is where the issue is. If the textbox text is changed and the focus is moved to a second control then the save button is clicked everything works fine.
Note: The textbox is displayed in editable rows of the RadGrid. There is an ontextchange event handler on the textbox. Therefore when text has changed and focus is lost on the textbox an ajax postback occurs to the server.
Any assistance would be much appreciated .
| Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) |
| If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then |
| Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) |
| Dim tmeStart As RadTimePicker = DirectCast(item.FindControl("tmeStart"), RadTimePicker) |
| Dim arrayList As New ArrayList |
| Dim dte As DateTime = CDate(Now.ToShortDateString) |
| arrayList.Add(dte.AddHours(14)) |
| arrayList.Add(dte.AddHours(14).AddMinutes(15)) |
| arrayList.Add(dte.AddHours(14).AddMinutes(30)) |
| arrayList.Add(dte.AddHours(14).AddMinutes(45)) |
| arrayList.Add(dte.AddHours(15)) |
| arrayList.Add(dte.AddHours(15).AddMinutes(15)) |
| arrayList.Add(dte.AddHours(15).AddMinutes(30)) |
| arrayList.Add(dte.AddHours(15).AddMinutes(45)) |
| arrayList.Add(dte.AddHours(16)) |
| arrayList.Add(dte.AddHours(16).AddMinutes(15)) |
| arrayList.Add(dte.AddHours(16).AddMinutes(30)) |
| arrayList.Add(dte.AddHours(16).AddMinutes(45)) |
| arrayList.Add(dte.AddHours(17)) |
| arrayList.Add(dte.AddHours(17).AddMinutes(15)) |
| arrayList.Add(dte.AddHours(17).AddMinutes(30)) |
| arrayList.Add(dte.AddHours(17).AddMinutes(45)) |
| tmeStart.TimeView.DataList.DataSource = arrayList |
| End If |
| End Sub |