This is a migrated thread and some comments may be shown as answers.
Control inside EditItemTemplate takes value from HiddenField which is in ItemTemplate
0 Answers 5 Views
This is a migrated thread and some comments may be shown as answers.
Evgeny
Top achievements
Rank 1
Evgeny asked on 20 Mar 2018, 01:18 PM

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.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Evgeny
Top achievements
Rank 1
Share this question
or