这是我的代码
aspx
<telerik:GridEditCommandColumn HeaderStyle-Width="25px" EditImageUrl="../images/Edit.gif"
ButtonType="ImageButton" ItemStyle-HorizontalAlign="Right">
</telerik:GridEditCommandColumn>
<telerik:GridTemplateColumn HeaderText="Comments" HeaderStyle-Width="400px" DataField="Comments"
HeaderStyle-CssClass="tblHeaderNoBorder">
<ItemTemplate>
<asp:Label runat="server" ID="lblComments" Text='<%# Eval("Comments") %>' />
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtComments" runat="server" Height="40px" Width="100%" TextMode="MultiLine"
Enabled="true" Text='<%# Eval("Comments") %>' BackColor="LightPink">
</telerik:RadTextBox></EditItemTemplate>
</telerik:GridTemplateColumn>
aspx.cs
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
{
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
{
GridEditableItem item = (GridEditableItem)e.Item;
RadTextBox txtComments = (RadTextBox)item.FindControl("txtComments");
RadGrid1.DataBind();
}
这是场景,当我单击更新时,这必须更新记录。如何更新记录?请帮我。
我还设置了 AllowAutomaticUpdate = "true"