J
Jacques Leclerc
I'm trying to insert an item into a dropDownList web control. What makes it
difficult is that the drop down is located within the EditItemTemplate of a
template column within a datgrid. The control only appears when the row of
the grid is being edited (std built in Edit, Update, Cancel feature). Where
in the code behind file do I put the insert code?
Attempting to do the insert within the OnDataBound event did not work.
Any ideas/suggestions as to where the code should be located will be
appreciated.
Thanks
Jacques Leclerc
Here's the code snippet showing how the control is defined in the apsx page.
<asp:TemplateColumn HeaderText="Next Survey<br>Page ID"
ItemStyle-CssClass="DataGridItem" HeaderStyle-CssClass="DataGridHeader">
<ItemTemplate>
<asp:Label Runat="server" ID="lblAnswerNextPage" Text='<%#
Container.DataItem("NextSurveyPageID")%>' />
</ItemTemplate>
<EditItemTemplate>
<aspropDownList Runat="server" ID="ddlAnswerNextPage"
DataValueField="SurveyPageID" DataTextField="PageName" DataSource="<%#
TheSurveyPage.GetPossibleNextPage(miSurveyID,miPageID,miQuestionID) %>" />
</EditItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel"
UpdateText="Update" ItemStyle-CssClass="DataGridItem"
HeaderStyle-CssClass="DataGridHeader" />
difficult is that the drop down is located within the EditItemTemplate of a
template column within a datgrid. The control only appears when the row of
the grid is being edited (std built in Edit, Update, Cancel feature). Where
in the code behind file do I put the insert code?
Attempting to do the insert within the OnDataBound event did not work.
Any ideas/suggestions as to where the code should be located will be
appreciated.
Thanks
Jacques Leclerc
Here's the code snippet showing how the control is defined in the apsx page.
<asp:TemplateColumn HeaderText="Next Survey<br>Page ID"
ItemStyle-CssClass="DataGridItem" HeaderStyle-CssClass="DataGridHeader">
<ItemTemplate>
<asp:Label Runat="server" ID="lblAnswerNextPage" Text='<%#
Container.DataItem("NextSurveyPageID")%>' />
</ItemTemplate>
<EditItemTemplate>
<aspropDownList Runat="server" ID="ddlAnswerNextPage"
DataValueField="SurveyPageID" DataTextField="PageName" DataSource="<%#
TheSurveyPage.GetPossibleNextPage(miSurveyID,miPageID,miQuestionID) %>" />
</EditItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel"
UpdateText="Update" ItemStyle-CssClass="DataGridItem"
HeaderStyle-CssClass="DataGridHeader" />