G
Guest
Hi
I have used the following code to essentially late bind an EditCommandColumn
to my datagrid in ASP.NET.
EditCommandColumn ec = new EditCommandColumn();
ec.ButtonType = ButtonColumnType.PushButton;
ec.CancelText = "Cancel";
ec.EditText = "Edit";
ec.HeaderText = "Rename";
ec.UpdateText = "Update";
ec.CausesValidation = true;
dtgResults.Columns.Add(ec);
ec = null;
However, the edit command that affects the grid in respect of changing
labels to textboxes does not fire even though I have set the datagrid to have
an OnUpdateCommand as follows
<asp
ataGrid id=dtgResults runat="server" AllowSorting="True"
OnDeleteCommand="DataDelete"
OnCancelCommand="DataCancel" OnEditCommand="DataEdit"
OnUpdateCommand="DataUpdate"
AllowPaging="True" PageSize="10" CellPadding="3"
BackColor="White"
BorderWidth="1px" AutoGenerateColumns="False"
AllowCustomPaging="false"
PagerStyle-Visible="false">
<FooterStyle CssClass="GridFooter" />
<SelectedItemStyle CssClass="GridItem" />
<ItemStyle CssClass="GridItem" />
<HeaderStyle CssClass="GridHeader" />
<AlternatingItemStyle CssClass="GridAlternateItem" />
</asp
ataGrid>
FYI, if i use the class method of creating the EditCommandColumn in the HTML
page, everything works fine
Any help would be appreciated
Ian
I have used the following code to essentially late bind an EditCommandColumn
to my datagrid in ASP.NET.
EditCommandColumn ec = new EditCommandColumn();
ec.ButtonType = ButtonColumnType.PushButton;
ec.CancelText = "Cancel";
ec.EditText = "Edit";
ec.HeaderText = "Rename";
ec.UpdateText = "Update";
ec.CausesValidation = true;
dtgResults.Columns.Add(ec);
ec = null;
However, the edit command that affects the grid in respect of changing
labels to textboxes does not fire even though I have set the datagrid to have
an OnUpdateCommand as follows
<asp
OnDeleteCommand="DataDelete"
OnCancelCommand="DataCancel" OnEditCommand="DataEdit"
OnUpdateCommand="DataUpdate"
AllowPaging="True" PageSize="10" CellPadding="3"
BackColor="White"
BorderWidth="1px" AutoGenerateColumns="False"
AllowCustomPaging="false"
PagerStyle-Visible="false">
<FooterStyle CssClass="GridFooter" />
<SelectedItemStyle CssClass="GridItem" />
<ItemStyle CssClass="GridItem" />
<HeaderStyle CssClass="GridHeader" />
<AlternatingItemStyle CssClass="GridAlternateItem" />
</asp
FYI, if i use the class method of creating the EditCommandColumn in the HTML
page, everything works fine
Any help would be appreciated
Ian