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
1095
RowEditingTemplate error
posted

It set up the template automatically.  I'm guessing it can grab the values of the cells in the row correctly.  Do you know how to easily circumvent this?

It throw an error when I double click a row to open it up for row editing.

Microsoft JScript runtime error: Sys.ArgumentNullException: The Row Edit Template behavior could not find associated template for editing. Please ensure a Template is defined for the behavior.
Parameter name: _templateDiv

<ig:WebDataGrid ID="dgvStaff" runat="server" Width="100%"
EnableDataViewState="True" DataKeyFields="stfGID" ClientIDMode="Static"
AutoGenerateColumns="False" onrowsdeleting="dgvStaff_Deleting"
onrowupdating="dgvStaff_Updating" onrowadding="dgvStaff_Adding">
<Columns>
<ig:BoundDataField DataFieldName="stfGID" Hidden="True" Key="stfGID">
<Header Text="stfGID" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="stfFK_cstGID" Hidden="True" Key="stfFK_cstGID">
<Header Text="stfFK_cstGID" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Position" Key="Position">
<Header Text="Position" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="First Name" Key="First Name">
<Header Text="First" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Last Name" Key="Last Name">
<Header Text="Last" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Email" Key="E-Mail">
<Header Text="Email" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Appts" Hidden="True" Key="Appts">
<Header Text="Appointment" />
</ig:BoundDataField>
<ig:TemplateDataField Key="Edit">
<Header Text="Delete / Edit" />
<ItemTemplate>
<asp:LinkButton ID="Delete" CssClass="sepV_a" OnClientClick="deleteRow(); return false" ToolTip="Delete" runat="server"><i class='splashy-calendar_day_remove'></i></asp:LinkButton>
<asp:LinkButton ID="Edit" CssClass="sepV_a" OnClientClick="editRow(); return false" ToolTip="Edit" runat="server"><i class='splashy-calendar_month_edit'></i></asp:LinkButton>
</ItemTemplate>
</ig:TemplateDataField>
</Columns>
<Behaviors>
<ig:Activation>
</ig:Activation>
<ig:EditingCore>
<Behaviors>
<ig:RowDeleting />
<ig:RowAdding />
<ig:RowEditingTemplate CancelButton="buttonCancel" OKButton="buttonOK">
<EditModeActions MouseClick="Double" />
<ClientBindings>
<ig:RowEditingClientBinding ColumnKey="Position" ControlID="control_Position"
GetValueJavaScript="$get({ClientID}).value"
SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
<ig:RowEditingClientBinding ColumnKey="First Name"
ControlID="control_First Name" GetValueJavaScript="$get({ClientID}).value"
SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
<ig:RowEditingClientBinding ColumnKey="Last Name" ControlID="control_Last Name"
GetValueJavaScript="$get({ClientID}).value"
SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
<ig:RowEditingClientBinding ColumnKey="E-Mail" ControlID="control_E-Mail"
GetValueJavaScript="$get({ClientID}).value"
SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
</ClientBindings>
</ig:RowEditingTemplate>
</Behaviors>
</ig:EditingCore>
<ig:Selection CellClickAction="Row" RowSelectType="Single">
</ig:Selection>
</Behaviors>
</ig:WebDataGrid>

  • 37874
    posted

    Hello OmegaPrime,

    You should add a Template, containing the controls you have refered in the  ClientBindings section of RowEditingTemplate:

    <ig:RowEditingTemplate CancelButton="buttonCancel" OKButton="buttonOK">

        <EditModeActions MouseClick="Double" />

        <ClientBindings>

            <ig:RowEditingClientBinding ColumnKey="Position" ControlID="control_Position" GetValueJavaScript="$get({ClientID}).value"

                SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />

            <ig:RowEditingClientBinding ColumnKey="First Name" ControlID="control_FirstName"

                GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />

            <ig:RowEditingClientBinding ColumnKey="Last Name" ControlID="control_LastName" GetValueJavaScript="$get({ClientID}).value"

                SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />

            <ig:RowEditingClientBinding ColumnKey="E-Mail" ControlID="control_EMail" GetValueJavaScript="$get({ClientID}).value"

                SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />

        </ClientBindings>

        <Template>

            <asp:TextBox ID="control_Position" runat="server"></asp:TextBox><br />

            <asp:TextBox ID="control_FirstName" runat="server"></asp:TextBox><br />

            <asp:TextBox ID="control_LastName" runat="server"></asp:TextBox><br />

            <asp:TextBox ID="control_EMail" runat="server"></asp:TextBox>

        </Template>

    </ig:RowEditingTemplate>

    Here you can find more information about row editing templates - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2012.1/CLR4.0/html/WebDataGrid_Enabling_Row_Editing_Template.html and a demo sample - http://ko.infragistics.com/products/aspnet/sample/data-grid/custom-edit-row-template.

    Let me know if this helps.