Hi
I try to trigger html5 validation inside a telerik:RedGrid and grid itself is inside telerik:RadAjaxPanel without luck. Here is a sample of the code:
As you can see from the sample code I provided at the end of the page that I am using <FormTemplate> to customize the form inside the grid on update and insert command, so I tried a workaround to trigger the validation via javascript by writing a hidden submit button
<input type="submit" style="display: none" name="submitButton" id="submitButton" /> and click it with javascript when ajax request started. And that did the trick with trigging the validation of html5 but a faced a new problem with firing the updated and insert command twice.
I hope that I explain the problem well enough.
Here is the sample of my code:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><%@ Register Assembly="Html5Asp" Namespace="Html5Asp" TagPrefix="cc1" %><div id="period"> <h1>Period time</h1> <telerik:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" runat="server"> <telerik:RadGrid ID="RadGrid_period" runat="server" AllowMultiRowSelection="true" Width="350px" OnNeedDataSource="RadGrid_period_NeedDataSource" AllowPaging="true" AllowSorting="true" PageSize="3" ImagesPath="../Images/Telerik/Grid" OnInsertCommand="RadGrid_period_InsertCommand" OnUpdateCommand="RadGrid_period_UpdateCommand" OnDeleteCommand="RadGrid_period_DeleteCommand"> <PagerStyle NextPageText=">" PrevPageText="<" Mode="NextPrevAndNumeric" PagerTextFormat="Change page: {4} | page {0} of {1}, number of periods: {5}." /> <ClientSettings> <Selecting AllowRowSelect="true" /> </ClientSettings> <MasterTableView DataKeyNames="Id" AutoGenerateColumns="false" CommandItemDisplay="Top" EditMode="EditForms"> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> <FormTableStyle CellPadding="2" CellSpacing="0" BackColor="White" Height="110px"></FormTableStyle> <FormMainTableStyle CellPadding="3" CellSpacing="0" GridLines="Horizontal" BackColor="White" Height="50px" Width="100%"></FormMainTableStyle> <FormTableItemStyle Wrap="False"></FormTableItemStyle> <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> </EditFormSettings> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Opdater" UniqueName="EditCommandColumn"> <HeaderStyle Width="30px" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn Text="Slet" DataTextField="username" CommandName="Delete" UniqueName="DeleteColumn" ButtonType="ImageButton" ItemStyle-Width="30px" ConfirmText="Do you want to remove the period ?"> <ItemStyle Width="30px"></ItemStyle> </telerik:GridButtonColumn> <telerik:GridBoundColumn HeaderText="id" DataType="System.int16" Display="false" DataField="Id" UniqueName="Id" Visible="false" /> <telerik:GridBoundColumn HeaderText="name" DataType="System.String" Display="true" DataField="Name" UniqueName="Name" Visible="true" /> <telerik:GridBoundColumn HeaderText="from time" DataType="System.TimeSpan" Display="true" DataField="FromTime" UniqueName="FromTime" Visible="true" /> <telerik:GridBoundColumn HeaderText="to time" DataType="System.TimeSpan" Display="true" DataField="ToTime" UniqueName="ToTime" Visible="true" /> <telerik:GridBoundColumn HeaderText="hoursPrMonth" DataType="System.int16" Display="false" DataField="HoursPrMonth" UniqueName="HoursPrMonth" Visible="true" /> </Columns> <EditFormSettings EditFormType="Template" ColumnNumber="1" CaptionDataField="name" CaptionFormatString="Change period name,from time and to time for period: {0}"> <FormTemplate> <div class="hidRowId"> <label>id</label> <cc1:TextInput ID="TextInput1" runat="server" Text='<%# Bind("Id") %>' IsReadOnly="true" /> </div> <div class="block"> <div class="div_LabelText"> <label>name:</label> </div> <cc1:TextInput ID="NameBox" runat="server" Text='<%# Bind("Name") %>' Required="true" /> </div> <div class="block"> <div class="div_LabelText"> <label>from time:</label> </div> <telerik:RadTimePicker ID="RadTimePickerFromTime" runat="server" DbSelectedDate='<%# Bind("FromTime") %>' /> </div> <div class="block"> <div class="div_LabelText"> <label>to time:</label> </div> <telerik:RadTimePicker ID="RadTimePickerToTime" runat="server" DbSelectedDate='<%# Bind("ToTime") %>' /> </div> <div class="block"> <div class="div_LabelText"> <label>hoursPrMonth:</label> </div> <cc1:NumberInput ID="hoursPrMonthBox" runat="server" Text='<%# Bind("HoursPrMonth") %>' /> </div> <div class="block"> <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' /> <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" FormNoValidate="true" /> </div> </FormTemplate> <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> </EditFormSettings> </MasterTableView> </telerik:RadGrid> </telerik:RadAjaxPanel></div><telerik:GridTemplateColumn> <EditItemTemplate> <p></p> <asp:Button runat="server" ID="btnAddBox" CommandArgument="WHAT!" CommandName="AddBox" Text="Add Box To This Batch" /> <p></p> <asp:DropDownList runat="server" ID="ddBoxList"></asp:DropDownList> <asp:Button runat="server" ID="btnRemoveBox" CommandArgument="WHAT!" CommandName="RemoveBox" Text="Remove Box" /> </EditItemTemplate> </telerik:GridTemplateColumn>Protected Sub rgBatchView_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles rgBatchView.ItemCommand If e.CommandName = "AddBox" Then Dim item = CType(e.Item, GridDataItem) Dim BatchID = item.GetDataKeyValue("BatchID") Dim b As New batch b.LoadBatch(BatchID) b.AddBox() notify.Show("Box Added!") ElseIf e.CommandName = "RemoveBox" Then Dim item = CType(e.Item, GridDataItem) Dim BatchID = item.GetDataKeyValue("BatchID") Dim b As New batch Dim dd As DropDownList = e.Item.Parent.FindControl("ddBoxList") ' **** This returns nothing, Also tried without ".parent" b.LoadBatch(BatchID) b.RemoveBox(dd.SelectedValue) notify.Show("Box Removed") End If End SubRadGrid1.ID = "RadGrid1" RadGrid1.Width = Unit.Pixel(1500) RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace RadGrid1.AllowPaging = True RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric RadGrid1.AutoGenerateColumns = False RadGrid1.ShowStatusBar = True RadGrid1.AllowSorting = True RadGrid1.AllowFilteringByColumn = True RadGrid1.Skin = "WebBlue" RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "GetGridObject" RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2 RadGrid1.ClientSettings.AllowColumnsReorder = True RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap RadGrid1.ClientSettings.Selecting.AllowRowSelect = True RadGrid1.ClientSettings.Resizing.AllowColumnResize = True RadGrid1.ClientSettings.Scrolling.AllowScroll = True RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = True RadGrid1.MasterTableView.PageSize = 100 RadGrid1.MasterTableView.AllowMultiColumnSorting = True RadGrid1.MasterTableView.DataKeyNames = New String() {"VendorListID", "Geography", "CirculationTypeID", "Day"} columnCreation("Geography", "Geography", RadGrid1) columnCreation("Circ Type", "CirculationTypeDescription", RadGrid1) columnCreation("Household", "HouseHold_Count", RadGrid1) columnCreation("Total Cov", "TotalCoverage", RadGrid1) columnCreation("Day", "Day", RadGrid1) columnCreation("Selected", "Selected", RadGrid1) columnCreation("Circ", "Circ", RadGrid1) columnCreation("Coverage", "Coverage", RadGrid1) columnCreation("Zones", "Zones", RadGrid1) RadGrid1.MasterTableView.HierarchyDefaultExpanded = True Dim tableSubCode As New GridTableView(RadGrid1) tableSubCode.Name = "SubCodes" tableSubCode.DataKeyNames = New String() {"VendorListID", "Geography", "CirculationTypeID", "Day", "Sub_Code"} tableSubCode.Width = Unit.Percentage(100) Dim relationFields1 As GridRelationFields = New GridRelationFields() relationFields1.MasterKeyField = "VendorListID" relationFields1.DetailKeyField = "VendorListID" tableSubCode.ParentTableRelation.Add(relationFields1) RadGrid1.MasterTableView.DetailTables.Add(tableSubCode) Dim relationFields2 As GridRelationFields = New GridRelationFields() relationFields2.MasterKeyField = "Geography" relationFields2.DetailKeyField = "Geography" tableSubCode.ParentTableRelation.Add(relationFields2) RadGrid1.MasterTableView.DetailTables.Add(tableSubCode) Dim relationFields3 As GridRelationFields = New GridRelationFields() relationFields3.MasterKeyField = "CirculationTypeID" relationFields3.DetailKeyField = "CirculationTypeID" tableSubCode.ParentTableRelation.Add(relationFields3) RadGrid1.MasterTableView.DetailTables.Add(tableSubCode) Dim relationFields4 As GridRelationFields = New GridRelationFields() relationFields4.MasterKeyField = "Day" relationFields4.DetailKeyField = "Day" tableSubCode.ParentTableRelation.Add(relationFields4) RadGrid1.MasterTableView.DetailTables.Add(tableSubCode) columnSubCodeCreation("SubCode", "Sub_Code", tableSubCode) columnSubCodeCreation("Household", "HouseHold_Count", tableSubCode) columnSubCodeCreation("Selected", "Selected", tableSubCode) columnSubCodeCreation("Circ", "Circ", tableSubCode) columnSubCodeCreation("Coverage", "Coverage", tableSubCode) Me.PlaceHolder1.Controls.Add(RadGrid1)RadGrid1_DetailTableDataBind
Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem) Select Case e.DetailTableView.Name Case "SubCodes" Dim vendorListID As Integer = dataItem.GetDataKeyValue("VendorListID").ToString() Dim Geography As String = dataItem.GetDataKeyValue("Geography").ToString() Dim CirculationTypeID As Integer = dataItem.GetDataKeyValue("CirculationTypeID").ToString() Dim Day As String = dataItem.GetDataKeyValue("Day").ToString() If mintCircSetID > 0 Then e.DetailTableView.DataSource = GetDataTable(mstrSQL & ",1,'" & Geography & "'," & CirculationTypeID & ",'" & Day & "'") End If End Select Currently have a rad grid that will load fine in development but once it is moved into production receive a script timeout error. In Production, the first load of the page works but have a RadComboBox that allows for Autopostback that changes the results in my RadGrid. It is at this point that I receive the timeout. Each time in production it will timeout after 30 seconds and have not figured out a way to stop it from timing out. I have compared the values with IIS to compare script timeouts and they are the same. It is trying to process 19,000 records, which I know it may take some time to query but in development the query doesn't take long at all to complete.
Following code is in web.config
<httpRuntime maxRequestLength="612353" executionTimeout="600"/>Code found in ASPX page as I seen this suggested by others.
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" AsyncPostBackTimeout="600"></telerik:RadScriptManager>Also added the following to my code and did not affect the outcome:
ValidateRequest="false"
In an attempt to resolve the problem I changed how my RadGrid would receive the data from client-side to code-behind where I could specify the command timeout and this has only caused the page to load for 5 seconds and not even return indications of and error. Just not update my RadGrid, though it will change a information box that was created.
Looking for suggestions that might help in resolving this error.

| <telerik:RadGrid ID="RadGrid1" runat="server" Width="70%" AllowPaging="True" |
| Height="400px" AllowMultiRowEdit="True" |
| BorderColor="Black" BorderWidth="1px" |
| onselectedindexchanged="RadGrid1_SelIndexChange" |
| onprerender="RadGrid1_PreRender" |
| OnItemCommand="RadGrid1_ItemCommand" |
| onNeedDataSource="RadGrid1_NeedDataSource1" onitemdatabound="RadGrid1_ItemDataBound" |
| AllowAutomaticUpdates="True" |
| > |
| <AlternatingItemStyle BackColor="#E8E8E8" Font-Bold="False" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| Wrap="True" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" /> |
| <MasterTableView AutoGenerateColumns="False" |
| Width="100%" BorderColor="Black" BorderWidth="0px" GridLines="None" |
| EditMode="InPlace" |
| CommandItemDisplay="TopAndBottom" > |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" /> |
| <telerik:GridTemplateColumn UniqueName="DeleteColumn" HeaderStyle-Width="70px"> |
| <EditItemTemplate> |
| <asp:Button ID="DeleteButton" runat="server" Text="Delete" /> |
| </EditItemTemplate> |
| <HeaderStyle Width="70px"></HeaderStyle> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn DataField="role" HeaderText="Role" |
| SortExpression="role" UniqueName="role" HeaderStyle-Width="150px"> |
| <EditItemTemplate> |
| <asp:Label ID="roleLabel" runat="server" Text='<%# Eval("role") %>' Width="150px"></asp:Label> |
| </EditItemTemplate> |
| <HeaderTemplate> |
| <asp:Label ID="rol_label" runat="server" Text="Role"></asp:Label> |
| </HeaderTemplate> |
| </Columns> |
| <CommandItemTemplate> |
| <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" /></CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| <Scrolling ScrollHeight="100%" AllowScroll="True" /> |
| <resizing allowcolumnresize="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
