Hi,
I wish to disable my radcombobox whilst the page loads, this is within a "usercontrol" and I am using jquery in the main page (which includes this control), and can use it here if that helps?
This returns a null reference for the combobox! I have looked at many threads to no avail, hopefully you can post an example for me.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="buyersguidefinderUserControl.ascx.cs"
Inherits="usercontrol_seo_buyersguidefinderUserControl" %>
<div class="fl">
<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="250px"
Height="300px" Filter="Contains" LoadingMessage="Finding Buyers Guide ..." EmptyMessage="Type which guide you would like to read..."
HighlightTemplatedItems="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
AutoPostBack="true">
</telerik:RadComboBox>
</div>
<div class="guidesearchbtn fl">
<asp:Button ID="Button1" runat="server" Text="Go" OnClick="Button1_Click" /></div>
<script language="javascript" type="text/javascript">
// <!CDATA[
// disable control otherwise it breaks page state
var combo = $find("<%= RadComboBox1.ClientID %>");
combo.Disable();
$(document).ready(function() {
combo.Enable();
});
// ]]>
</script>
Thanks again,
Matt
9 Answers, 1 is accepted
Best wishes,
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
function
onLoad(sender) {
sender.enable();
}
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Using the declarative disabled/client onload method worked great.
Could you possibly point me to the docs on explaining the page lifecycle and how / when we can hook into telerik controls using jquery if required. If not, could someone blog about best pratices?
Cheers
Matt
Client pageLoad always fires AFTER Server-side Page_Load event and before Serer-Side Page_PreRender. Therefore, I usually utilise Server-Side Page_Load for any initialisation that deemed necessary, through an 'If Not IsPostBack' block. However, if I wish to handle initilisation on Client, I pass a value to a HiddenField during the 'If Not IsPostBack' then capture said value on Client during pageLoad, do whatever intialisation required then clear the HiddenField. This way, I avoid processing intialisation on every pageLoad on client (i.e. simulating 'Not IsPostBack').
If you have a Master page, then the sequence would be as follows (I think):
- Master Server-side Page_Load.
- Content Page Server-side Page_Load.
- Client pageLoad.
As for links, I believe MSDN has a thorough documentation on page lifecycle, but can't recall the links now. May be Telerik folks could assist here.
Hope this helps.
Regards,
Saed
All the best,
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
And thank you Saed for your comments above, it is all helpful.
All the best,
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
How disable the Telerik Radcombobox using jquery on ready method of jquery .
Try the following javascript to disable ComboBox.
JS:
<script type=
"text/javascript"
>
$(document).ready(
function
() {
var
combo = $find(
'Radcombobox1'
);
combo.disable();
});
</script>
Thanks,
Princy.