I'm using a great book "
ASP.NET Data Web Controls" by Scott Mitchell.
In this book I see a screenshot of a datagrid that when the "Edit"
hyperlink button is pressed all the editable fields turn into
textboxes. I wondering how to accomplish this.
Also how do you allow only one row to be chosen? When I hit my edit
button on a row the hyperlink button changes colors, but when I choose
another row the first button is still changed in color? Also when I
hit the button I'm expecting to see "Update" and "Cancel" appear, but
it doesn't. Here is my html if anyone can see any modifications I
should do to accomplish any or all the above.
Thanks!
<asp:datagrid id="dgEvents" runat="server" AutoGenerateColumns="False"
Font-Name="Verdana" Font-Size="X-Small"
HorizontalAlign="Center" ItemStyle-
BackColor="#C0FFC0"
AlternatingItemStyle-BackColor="White" Width="732px"
Height="128px"
AllowSorting="True" BorderColor="PeachPuff"
BorderStyle="Outset"
BorderWidth="10px" CellPadding="10" Font-
Names="Verdana"
BackColor="#FFCC99" Font-Bold="False" Font-
Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False"
DataKeyField="EventID"
OnCommandUpdate="dgEvents_UpdateRow"
OnCommandEdit="dgEvents_EditRow"
OnCommandCancel="dgEvents_CancelRow">
<HeaderStyle BackColor="DarkGreen" HorizontalAlign="Center"
ForeColor="White"
Font-Bold="True"/>
<Columns>
<asp:BoundColumn HeaderText="EventID" DataField="EventID"
ReadOnly="true"/>
<asp:BoundColumn HeaderText="Event" DataField="event" />
<asp:BoundColumn HeaderText="Year" DataField="year" />
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit"
UpdateText="Update">
</asp:EditCommandColumn>
</Columns>
<EditItemStyle BackColor="#FFCC99" Font-Bold="False" Font-
Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-
Underline="False" />
<AlternatingItemStyle BackColor="White" />
<ItemStyle BackColor="#C0FFC0" />
</asp:datagrid>