OnClientClick="return confirm('Are you sure you want to delete?')
and it works great. However if no check boxes are checked and delete button is pressed i want to display different validation message. <telerik:RadGrid GridLines="None" ID="grdInventory" AllowMultiRowSelection="True"Style="border: 1" runat="server" AllowPaging="True" AllowSorting="True" PageSize="10"Width="95%" Height="220px" AllowAutomaticDeletes="True" EnableLinqExpressions="false"OnNeedDataSource="grdInventory_NeedDataSource" OnItemCommand="grdInventory_ItemCommand"><MasterTableView AutoGenerateColumns="False" Width="100%" CommandItemDisplay="Bottom" DataKeyNames="Id"> <CommandItemTemplate> <div style="padding: 5px 5px;"> <asp:LinkButton ID="btnAdd" runat="server" OnClick="btnAdd_Click">Add</asp:LinkButton> <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return confirm('Are you sure you want to delete?');" OnClick="btnDelete_Click"> Delete</asp:LinkButton> </div> </CommandItemTemplate> <Columns> <telerik:GridClientSelectColumn UniqueName="SelectColumn"> <HeaderStyle Width="30px" /> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn DataField="SizeName" DataType="System.String" HeaderText="Size" UniqueName="SizeName"> <HeaderStyle Width="100px" /> <ItemStyle Wrap="False" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataFormatString="{0:d}" DataField="Date" DataType="System.DateTime" HeaderText="Reserved Date" SortExpression="Date" UniqueName="Date"> <HeaderStyle Width="100px" /> <ItemStyle Wrap="False" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Available" DataType="System.String" HeaderText="Available" UniqueName="Available"> <HeaderStyle Width="100px" /> <ItemStyle Wrap="False" /> </telerik:GridBoundColumn> <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" ConfirmText="Are you sure you want to delete?" UniqueName="DeleteColumn" ImageUrl="../../Images/MediaTree/DeleteIcon.png"> <HeaderStyle Width="30px" /> </telerik:GridButtonColumn> </Columns></MasterTableView></telerik:RadGrid>Protected Sub myRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound If ((TypeOf (e.Item) Is GridEditFormItem) And (e.Item.IsInEditMode)) Then '*** this will never be reached. End IfEnd SubPrivate Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRenderFor rowindex = RadGrid1.Items.Count - 1 To 0 Step -1 Dim row As GridDataItem = RadGrid1.Items(rowindex) If row.Cells(9).Text = "T" Then 'Hides the Edit command for the row with Category = T row.Cells(6).Controls(0).Visible = False End If Next End Sub<ClientSettings> <ClientEvents OnRowDblClick="RowDblClick" /></ClientSettings><telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function RowDblClick(sender, eventArgs) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); } </script></telerik:RadCodeBlock>Hi All,
I have a bug that is a bit strange and hard to reproduce. I think (not sure as I did not get the JS warnings) I was able to reproduce it on your demo site, here:
http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx
The steps to reproduce are:
- Dynamically created docks (with autopostback and Save/Load State).
- Click the header like crazy (about 10+ times)
- First I get a 'undefined' is null or not an object Line: 5869
- If I then try to move the dock, I get:
==========================================
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 26 Mar 2009 04:36:58 UTC
Message: 'undefined' is null or not an object
Line: 5869
Char: 1
Code: 0
URI: http://localhost/RiskShield/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_sm_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af48f6488-574a-46fe-9b15-624f013d8c03%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3aed16cbdc%3a854aa0a7%3a874f8ea2%3a5a6d9d23
Message: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":0,"Left":0,"DockZoneID":"ctl00_c_rdzDash","Collapsed":false,"Pinned":false,"Resizable":false,"Closed":false,"Width":"305px","Height":"331px","ExpandedHeight":0,"Index":1}.
Line: 6
Char: 62099
Code: 0
URI: http://localhost/RiskShield/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_sm_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af48f6488-574a-46fe-9b15-624f013d8c03%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3aed16cbdc%3a854aa0a7%3a874f8ea2%3a5a6d9d23
Any help would be greatly appreciated.
Thanks
Guido Tapia