Hi,
Ok I have two grids, a parents Customer Grid and a child Orders grid, the child grid is in the edit form of the parent Customer Grid.
In the Orders Grid I have two Item Template columns. and have validators in these columns. I am trying to find these in the edit row in client side code but having a really hard time?!? Can someone from the Telerik team show me by a code example how can I achieve this?? Your helps really appreciated and please give an example by code. thanks!! **Please see my comments below above the Javascript code
Here are the item templates in the OrdersGrid
Here is what I have on the client side for checking the edit row in the orders grid, please let me know how can I access validators "RequiredOrderName" and "RequiredOrderAdd" ?? The grid has only single row edit allowed so should be only one row in edit mode at a time. I am trying to attach the Jquery validation plugin to the validator. http://plugins.jquery.com/project/updnValidatorCallout
Ok I have two grids, a parents Customer Grid and a child Orders grid, the child grid is in the edit form of the parent Customer Grid.
In the Orders Grid I have two Item Template columns. and have validators in these columns. I am trying to find these in the edit row in client side code but having a really hard time?!? Can someone from the Telerik team show me by a code example how can I achieve this?? Your helps really appreciated and please give an example by code. thanks!! **Please see my comments below above the Javascript code
Here are the item templates in the OrdersGrid
<telerik:GridTemplateColumn DataField="Order" HeaderText="OrderName" SortExpression="owner" UniqueName="OrderName" AutoPostBackOnFilter="true" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" > <ItemTemplate> <asp:Label runat="server" ID="lblOrderName" Text='<%# Eval("OrderName") %>' ToolTip="Owner/Private Car Mark"></asp:Label> </ItemTemplate> <EditItemTemplate> <span><asp:TextBox runat="server" ID="txtOrderName" Text='<%# Bind("OrderName") %>' ></asp:TextBox><span style="color: Red"> <asp:RequiredFieldValidator ID="RequiredOrderName" ControlToValidate="txtOrderName"
ErrorMessage="Order Name is required" runat="server"> </asp:RequiredFieldValidator> </span> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="OrderAdd" HeaderText="Order Address" UniqueName="OrderAdd" AutoPostBackOnFilter="true" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" > <ItemTemplate> <asp:Label runat="server" ID="lblOrderAdd" Text='<%# Eval("OrderAdd") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <span><asp:TextBox runat="server" ID="txtOrderAdd" Text='<%# Bind("OrderAdd") %>' ></asp:TextBox><span style="color: Red"> <asp:RequiredFieldValidator ID="RequiredOrderAdd" ControlToValidate="txtOrderAdd" ErrorMessage="Order Address is required" runat="server"> </asp:RequiredFieldValidator> </span> </EditItemTemplate> </telerik:GridTemplateColumn>Here is what I have on the client side for checking the edit row in the orders grid, please let me know how can I access validators "RequiredOrderName" and "RequiredOrderAdd" ?? The grid has only single row edit allowed so should be only one row in edit mode at a time. I am trying to attach the Jquery validation plugin to the validator. http://plugins.jquery.com/project/updnValidatorCallout
function pageLoad(source, eventArgs) { //debugger; var grid = $telerik.$('[id$=CustomersGrid]'); if (grid != null) { var gridObj = $find(grid.attr("id")); var masterTable = gridObj.get_masterTableView(); var isInEditMode = false; if (gridObj.get_editItems().length > 0) { isInEditMode = true; } if (masterTable.get_isItemInserted() == true || isInEditMode == true) { var Ordergrid = $telerik.$('[id$=OrdersGrid]'); if (Ordergrid != null) { var orderGridObj = $find(Ordergrid.attr("id")); var ordermasterTable = orderGridObj.get_masterTableView(); if (AARgridObj.get_editItems().length > 0) { // var editedItem = ordermasterTable.editItem(ordermasterTable.get_dataItems()[0].get_element()); var editedItems = orderGridObj.get_editItems() for (var i = 0; i < editedItems.length; i++) { // How to get the validators here?? I want to get the validators from the edit row and // attach the $updnValidatorCallout to them? // var item = editedItems[0];
// var RequiredOrderName = item._element.cells[1].children[0]; // var RequiredOrderAdd = item._element.cells[2].children[0]; // $(ownerValidator).updnValidatorCallout(); // $(carValidator).updnValidatorCallout(); } } else { $.updnValidatorCallout.attachAll(); } } } } }