T
tshad
I have a DataList that I have set up to allow editing. The edit button does
go to the subroutine defined by OnEditCommand. The problem is that it
doesn't change the fields to editing fields. The textbox doesn't show from
the edititemtemplate section. I don't get any errors.
Do I need to do something special to tell it to do this?
Here is the datalist:
********************************************************************************************
<asp:datalist id="DataList1"
runat="server"
Width="100%"
BorderWidth="0px"
OnEditCommand="DataListEdit"
OnUpdateCommand="DataListUpdate"
OnCancelCommand="DataListCancel"
footerstyle-horizontalalign="center"
CellPadding="0"
CellSpacing="0"
Border="0"
style="margin:0">
<AlternatingItemStyle cssClass=alternateRow ></AlternatingItemStyle>
<ItemTemplate>
<table border="0" width="100%" CellPadding="0" CellSpacing="0"
style="margin:0">
<tr>
<td width="100%">
<%# DataBinder.Eval(Container.DataItem, "Question") %>
</td>
<td width="30">
<asp:button Text="Edit" runat="server" CommandName="Edit" />
</td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table border="0" width="100%" CellPadding="0" CellSpacing="0"
style="margin:0">
<tr>
<td width="100%">
<asp:TextBox id="txtQuestion" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Question") %>' />
</td>
<td width="30">
<asp:button Text="Update" runat="server" CommandName="Update" />
<asp:button Text="Cancel" runat="server" CommandName="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
</asp:datalist>
********************************************************************************************
Thanks,
Tom
go to the subroutine defined by OnEditCommand. The problem is that it
doesn't change the fields to editing fields. The textbox doesn't show from
the edititemtemplate section. I don't get any errors.
Do I need to do something special to tell it to do this?
Here is the datalist:
********************************************************************************************
<asp:datalist id="DataList1"
runat="server"
Width="100%"
BorderWidth="0px"
OnEditCommand="DataListEdit"
OnUpdateCommand="DataListUpdate"
OnCancelCommand="DataListCancel"
footerstyle-horizontalalign="center"
CellPadding="0"
CellSpacing="0"
Border="0"
style="margin:0">
<AlternatingItemStyle cssClass=alternateRow ></AlternatingItemStyle>
<ItemTemplate>
<table border="0" width="100%" CellPadding="0" CellSpacing="0"
style="margin:0">
<tr>
<td width="100%">
<%# DataBinder.Eval(Container.DataItem, "Question") %>
</td>
<td width="30">
<asp:button Text="Edit" runat="server" CommandName="Edit" />
</td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table border="0" width="100%" CellPadding="0" CellSpacing="0"
style="margin:0">
<tr>
<td width="100%">
<asp:TextBox id="txtQuestion" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Question") %>' />
</td>
<td width="30">
<asp:button Text="Update" runat="server" CommandName="Update" />
<asp:button Text="Cancel" runat="server" CommandName="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
</asp:datalist>
********************************************************************************************
Thanks,
Tom