| <CommandItemTemplate> |
| <table width="100%" style="margin: 5px"> |
| <td align="left"> |
| <span class="GridTitle">Accounts</span> |
| </td> |
| <td align="right"> |
| <asp:LinkButton runat="server" class="GridCommandButtonText" CommandName="InitInsert"> |
| <img style="border:0px;vertical-align:middle;" alt="Insert" src='<%= ToAbsoluteURL("~/Images/Add_24.png") %>' /> Add new account |
| </asp:LinkButton> |
| <asp:LinkButton runat="server" class="GridCommandButtonText" CommandName="RebindGrid"> |
| <img style="border:0px;vertical-align:middle;" alt="Refresh" src='<%= ToAbsoluteURL("~/Images/Refresh_24.png") %>' /> Refresh account list |
| </asp:LinkButton> |
| </td> |
| </table> |
| </CommandItemTemplate> |
| <MasterTableView Width="100%" Name="Master" HierarchyLoadMode="ServerBind" DataKeyNames="InvoiceId" |
| HorizontalAlign="NotSet" CommandItemDisplay="Top"> |
| <DetailTables> |
| <telerik:GridTableView Name="Detail" BackColor="White" AllowNaturalSort="true" runat="server" |
| DataKeyNames="invoiceidfkid" Width="100%"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields MasterKeyField="InvoiceId" DetailKeyField="invoiceidfkid"> |
| </telerik:GridRelationFields> |
| </ParentTableRelation> |
| <script type="text/javascript"> |
| function ShowPopup() |
| { |
| var datetimepicker = $find("<%= txtcalMeetingDate.ClientID %>"); |
| datetimepicker.showPopup(); // Show Calendar popup |
| } |
| </script> |
<asp:button runat = "server" name= "View Calendar" id = "CalendarPopup1" visible = "false" />
and in code-behind:
CalendarPopup1.Attributes.Add(
"onClick", "ShowPopup();");
var
teclatextbox= false;
function
TeclaTextbox(presionada)
{
teclatextbox= presionada;
}
function
BodyKeyDown(e)
{
var key;
if (window.event)//IE
key= window.
event.keyCode;
else//Firefox
key= e.which;
if(!e) var e = window.event;//take event
if (key == 8 && !teclatextbox)//BACKSPACE and it is not inside a textbox
{//stop the default behavior
e.cancelBubble =
true;
e.returnValue =
false;
if (e.stopPropagation)
{
e.stopPropagation();
e.preventDefault();
}
return false;
}
return true;
}
textbox events to permit backspace only inside the textboxes:
<
asp:TextBox ID="txbComentarios" runat="server" onkeydown="javascript:TeclaTextbox(true);" onkeyup="javascript:TeclaTextbox(false);" onblur="javascript:TeclaTextbox(false);"></asp:TextBox>
Regards,
Daniel.