Control inside EditItemTemplate takes value from HiddenField which is in ItemTemplate

1 posts, 0 answers
  1. Evgeny
    Evgeny avatar
    2 posts
    Member since:
    Jun 2016

    Posted 20 Mar 2018 Link to this post

    I have the following html:

    <sq8:GridTemplateColumn DataField="FieldToFillChoiceValue" FilterImageToolTip="" HeaderText="" SortExpression="FieldToFillChoiceValue" UniqueName="FieldToFillValue" FilterControlAltText="">
        <EditItemTemplate>
            <sq8:TextBox runat="server" ID="tbFieldToFill" ValidationGroup="DecisionGroup" />
            <sq:BindableControl runat="server" TargetControlID="tbFieldToFill" DataField="FieldToFillTextValue"></sq:BindableControl>
            <asp:CustomValidator runat="server" ErrorMessage="CustomValidator" ID="cvFieldToFill" ValidationGroup="DecisionGroup"></asp:CustomValidator>
            <sq8:ComboBox runat="server" ID="cmbFieldToFill" ValidationGroup="DecisionGroup">
                <Localization NoMatches="" ShowMoreFormatString="" AllItemsCheckedString="" ItemsCheckedString="" CheckAllString="" MoreItemsWithoutTotalRowCount="" NoMoreItemsWithoutTotalRowCount=""></Localization>
            </sq8:ComboBox>
            <sq:BindableControl runat="server" TargetControlID="cmbFieldToFill" DataField="FieldToFillChoiceValue" />
        </EditItemTemplate>
        <ItemTemplate>
            <asp:Literal runat="server" ID="FieldToFillChoiceValue" Mode="Encode" />
            <sq:BindableControl runat="server" TargetControlID="FieldToFillChoiceValue" DataField="FieldToFillChoiceValue" />
            <asp:HiddenField runat="server" ID="hfFieldType" />
            <sq:BindableControl runat="server" TargetControlID="hfFieldType" DataField="FieldToFillType"></sq:BindableControl>
        </ItemTemplate>
    </sq8:GridTemplateColumn>

     

    And I'm signed to OnBatchEditOpening and OnBatchEditOpened events.

    My problem is that when I get to the OnBatchEditOpened handler, the value of tbFieldToFill is "TextBox" (which is the value of the hidden field) without me setting or binding any value to the control.

    In the OnBatchEditOpening handler, the text box still haven't been rendered.

    How and why does the value get into the textbox control?

    Thanks for any help.

Back to Top