how can I disable this for the raddatepicker ? can you please provide an example ?
function disableEnterKey(sender, eventArgs)
{
var key = eventArgs.get_keyCode();
if(key && key == 13)
eventArgs.set_cancel(
true);
}
<telerik:RadNumericTextBox
ShowSpinButtons="False"
Skin="Office2007"
Type="Currency"
width="155px"
ID="txtUnitPrice"
runat="server" DbValue='<%# Bind("UNIT_SELLING_PRICE") %>' InvalidStyleDuration="100"
MinValue='<%#Convert.ToDouble(ConfigurationManager.AppSettings["MinNumber"].ToString())%>'
MaxValue='<%#Convert.ToDouble(ConfigurationManager.AppSettings["MaxNumber"].ToString())%>'
>
<NumberFormat AllowRounding="True" KeepNotRoundedValue="False" />
<ClientEvents OnKeyPress="disableEnterKey" />
</telerik:RadNumericTextBox>
6 Answers, 1 is accepted
Try attaching the disableEnterKey() function to client event of DateInput of datepicker as shown below and see whether it is working fine.
ASPX:
<telerik:RadDatePicker ID="RadDatePicker1" runat="server"> |
<DateInput runat="server"> |
<ClientEvents OnKeyPress="disableEnterKey" /> |
</DateInput> |
</telerik:RadDatePicker> |
Thanks,
Shinu.
Here is another approach:
function handleClickEvent(sender, args) |
{ |
argsargs = args || window.event; |
if (args.keyCode == 13) |
{ |
args.cancelBubble = true; |
args.returnValue = false; |
if (args.preventDefault) args.preventDefault(); |
if (args.stopPropagation) args.stopPropagation(); |
} |
} |
<telerik:RadDatePicker ID="RadDatePicker1" runat="server" onkeydown="handleClickEvent(this,event)"> |
</telerik:RadDatePicker> |
Regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
<
telerik:GridCheckBoxColumn DataField="TAXABLE_FLAG" DataType="System.Boolean" HeaderText="Taxable"
UniqueName="TAXABLE_FLAG" EditFormColumnIndex="1">
<HeaderStyle Width="50px" />
<ItemStyle HorizontalAlign="center" Width="50px" />
</telerik:GridCheckBoxColumn>
You may consider attaching a client event to the disabled asp CheckBox control inside built-in GridCheckBoxColumn with the approach from this online demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/accessingcellsandrows/defaultcs.aspx
(hooking client instead of server event for the relevant checkbox)
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
<asp:Button ID="hidDisableEnter" runat="server" OnClientClick="return false;" BorderStyle="None" Height="0" Width="0" />