This is a migrated thread and some comments may be shown as answers.

GridTemplateColumn field on EditForm

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kermit
Top achievements
Rank 1
Kermit asked on 25 Oct 2012, 06:45 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 Oct 2012, 03:23 AM
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.
Tags
Grid
Asked by
Kermit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or