GridTemplateColumn field on EditForm

2 posts, 1 answers
  1. Kermit
    Kermit avatar
    20 posts
    Member since:
    Jan 2012

    Posted 25 Oct 2012 Link to this post

    How do I get an asp:label field that is contained within a GridTemplateColumn and bound to an underlying data field to appear as an editable field on an EditForm that is displayed by clicking Edit in a GridEditCommandColumn?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Oct 2012 Link to this post

    Hi,

    Try using the GridTemplateColumn as follows.

    ASPX:
    <telerik:RadGrid ID="rad" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="false">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <asp:Label runat="server" ID="Label1" Text='<%# Eval("OrderID") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("OrderID") %>'></asp:TextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridEditCommandColumn>
                </telerik:GridEditCommandColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top