Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1445
How to clear controls on the rowEditTempalte?
posted

I am using the rowEditTemplate. I am using it to add a new record to the grid. I can add the first record ok, but when I add the second record it looks like the fields never get cleared out. I went to set the control back to its init value. When I tried doing something like this on webNumericEditor, it looks like it saved the value = 0 but when I run a validation on it the value is the old value and not 0.

 

 

 

 

 

var t = $find('<%= grdExpense.ClientID %>'

).get_behaviors().get_editingCore().get_behaviors().get_rowEditingTemplate();

 

 

 

var binding = t._bindings._getObjectByAdr("colTotalPaid");

 

 

This is how that field is setup in the grid and on the template

<

 

 

ig:BoundDataField DataFieldName="Total" Key="colTotalPaid" Width="100px" Header-Text="Total Paid" DataType="System.Decimal" DataFormatString="{0:N2}"/>

 

template ...

<

 

 

ig:RowEditingClientBinding ColumnKey="colTotalPaid" ControlID="editorTxtTotalPaid" GetValueJavaScript="getEditorValue({ClientID})" SetValueJavaScript="setInnerText({ClientID},{value}, true)" />

This works the first time through but not the second.  Here is the validation for this control

<

 

 

asp:CustomValidator ClientValidationFunction="CheckTotalPaid" ID="rfvTxtTotalPaid" runat="server" ErrorMessage="Total Paid is Required." text="*" Font-Bold="True" Font-Size="Large" Display="Dynamic" ControlToValidate="editorTxtTotalPaid" InitialValue="0" ValidationGroup="templateValidation"/>

 

 

Parents
  • 49378
    posted

    Hi apalcer,

    The RowEditingTemplate is designed for editing existing rows, not adding new ones. You may want to consider creating another template for row addition.

    Please contact me if you require further assistance.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

     

     

Reply Children
No Data