This is a migrated thread and some comments may be shown as answers.

Weird javascript error Ajax'd RadGrid and RadInputManager

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 11 Aug 2010, 04:39 AM
Hi

I have a weird error... I have a bunch of TextBox's and a RadGrid which is ajaxified with auto updates enabled. These TextBox's, and the TextBox's in the editable template in the RadGrid use a RadInputManager.

<telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server" LoadingPanelID="AjaxLoadingPanel">
<telerik:RadGrid ID="rgPriceLists" runat="server" Width="600px" Skin="Default" AutoGenerateColumns="false" DataSourceID="objPriceLists"">
    <MasterTableView EnableNoRecordsTemplate="false" Width="100%" DataKeyNames="PriceListId" AllowAutomaticUpdates="true" EditMode="InPlace">
        <Columns>
            <telerik:GridBoundColumn HeaderText="Name" DataField="Name" ReadOnly="true" />
            <telerik:GridBoundColumn HeaderText="Pub" DataField="Pub" ReadOnly="true" />
            <telerik:GridTemplateColumn HeaderText="Price">
                <ItemTemplate>
                    <asp:Label ID="lblPrice" runat="server" Text='<%# GetCulturedPriceOrBlank(Eval("Price") == null ? 0 : (decimal)Eval("Price"), 0.0m, (string)Eval("Pub")) %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="tbPrice" runat="server" Text='<%# Bind("Price") %>' Columns="7" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Tax">
                <ItemTemplate>
                    <asp:Label ID="lblTax" runat="server" Text='<%# GetCulturedPriceOrBlank(Eval("Tax") == null ? 0 : (decimal)Eval("Tax"), 0.0m, (string)Eval("Pub")) %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="tbTax" runat="server" Text='<%# Bind("Tax") %>' Columns="7" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Active?">
                <ItemTemplate>
                    <asp:CheckBox ID="cbIsActive" runat="server" Checked='<%# Eval("IsActive") ?? false %>' Enabled="false" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:CheckBox ID="cbIsActive" runat="server" Checked='<%# Bind("IsActive") %>' />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn ItemStyle-Width="40" ItemStyle-HorizontalAlign="Right" ButtonType="ImageButton" UniqueName="EditCommandColumn" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
</telerik:RadAjaxPanel>

<telerik:RadInputManager ID="RadInputManager1" runat="server">
    <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1">
        <Validation IsRequired="true" ValidationGroup="ValidatePage" />
        <TargetControls>
            <telerik:TargetInput ControlID="tbProductName" />
        </TargetControls>
    </telerik:TextBoxSetting>
    <%--<telerik:TextBoxSetting BehaviorID="TextBoxBehavior2">
        <Validation IsRequired="false" />
        <TargetControls>
            <telerik:TargetInput ControlID="tbProductSpecialDescriptionDisplay" />
            <telerik:TargetInput ControlID="tbFuturePayDesc" />
            <telerik:TargetInput ControlID="tbProductShortName" />
            <telerik:TargetInput ControlID="tbPromoCode" />
        </TargetControls>
    </telerik:TextBoxSetting>--%>
    <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting1" Type="Currency">
        <Validation IsRequired="true" ValidationGroup="ValidatePage" />
        <TargetControls>
            <telerik:TargetInput ControlID="tbProductPriceExTax" />
            <telerik:TargetInput ControlID="tbProductPriceTax" />
        </TargetControls>
    </telerik:NumericTextBoxSetting>
    <%--<telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting2" Type="Number" DecimalDigits="0" AllowRounding="False" GroupSeparator="">
        <Validation IsRequired="true" ValidationGroup="ValidatePage" />
        <TargetControls>
            <telerik:TargetInput ControlID="tbProductDurationDays" />
            <telerik:TargetInput ControlID="tbProdIdUpgradeTo" />
            <telerik:TargetInput ControlID="tbProdIdUpgradeFrom" />
            <telerik:TargetInput ControlID="tbProdIdDiscountedForDefaultProduct" />
            <telerik:TargetInput ControlID="tbRenewsInto" />
        </TargetControls>
    </telerik:NumericTextBoxSetting>--%>
    <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting3" Type="Currency">
        <Validation IsRequired="false" />
        <TargetControls>
            <telerik:TargetInput ControlID="tbPrice" />
            <telerik:TargetInput ControlID="tbTax" />
        </TargetControls>
    </telerik:NumericTextBoxSetting>
</telerik:RadInputManager>

As you can see, I have 2 blocks in the RadInputManager commented out. The RadGrid correctly Ajaxifies the edit/update commands when these blocks are commented out. However when i uncomment out 1 of those RadInputManager blocks, I get a javascript error on the initial edit "a is null" in Telerik.Web.UI.WebResource.axd

Why?? :(

1 Answer, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 11 Aug 2010, 07:27 AM
Sorry fixed... I have some TextBox's hidden, but they were still in the RadInputManager. I have now changed code to only add controls in the RadInputManager that are not hidden.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Share this question
or