I have put together a datagrid, it will only ever return one record, but the editCommandColumn edit button (in fact all the buttons) takes 2 clicks before a response happens. Any ideas why this happens?
2nd question, related... I have not been able to put an edit button in the item template. Any idease how to do this? (I just would like to avoid a second column.) So far this datagrid has been acting funny.
3rd question (this datagrid has been acting funny.) When I do get Edit to fire I simply do a postback with this command:
but the text from the second field (YBK) remains. How could I clear that out?
2nd question, related... I have not been able to put an edit button in the item template. Any idease how to do this? (I just would like to avoid a second column.) So far this datagrid has been acting funny.
3rd question (this datagrid has been acting funny.) When I do get Edit to fire I simply do a postback with this command:
Code:
jobInfoDG.EditItemIndex = e.Item.ItemIndex
Code:
<asp:datagrid id="jobInfoDG" runat="server" AutoGenerateColumns="False" ShowHeader="False" onEditCommand="doEdit" onCancelCommand="doCancel" onUpdateCommand="doUpdate">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<TABLE align="center">
<TR>
<TD><B>Subject ID:</B></TD>
<TD><%# container.DataItem ("SubjectID") %></TD>
</TR>
<TR>
<TD><B>Style:</B></TD>
<TD><%# container.DataItem ("YBK") %></TD>
</TR>
<TR>
<TD><B>Quantity:</B></TD>
<TD><%# container.DataItem ("YBQTY") %></TD>
</TR>
</TABLE>
</ItemTemplate>
<EditItemTemplate>
<TABLE align="center">
<TR>
<TD><B>Image ID:</B></TD>
<TD><%# container.DataItem ("Name") %></TD>
</TR>
<TR>
<TD><B>Style:</B></TD>
<TD>
<asp:DropDownList id="DropDownList1" runat="server">
<asp:ListItem Value="YBK">Color</asp:ListItem>
<asp:ListItem Value="YBKBW">B&W</asp:ListItem>
<asp:ListItem Value="YBK35">Custom Color</asp:ListItem>
<asp:ListItem Value="YBK35BW">Custom B&W</asp:ListItem>
<asp:ListItem Value="YBKS">Ybk Strip</asp:ListItem>
</asp:DropDownList></TD>
</TR>
<TR>
<TD><B>Quantity:</B></TD>
<TD>
<ASP:textbox id="Textbox3" runat="server" Width="50px"></ASP:textbox></TD>
</TR>
</TABLE>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
</Columns>
</asp:datagrid>