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

Whether the item.UpdateValues () only works for GridBoundColumn instead of GridTemplateColumn?

1 Answer 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 07 Sep 2012, 02:57 AM
Whether the item.UpdateValues ()  only works for GridBoundColumn instead of GridTemplateColumn in Update_Command event? Since I have no way to get updated item by UpdateValues if the column is GridTemplateColumn.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Sep 2012, 05:21 AM
Hi Jin,

In order to extract values from a template you should use two-way binding through Bind instead of one-way (Eval). Please take a look into the sample code.

ASPX:
<telerik:GridTemplateColumn HeaderText="FirstName" UniqueName="FirstNameTemplate"
    <ItemTemplate>
        <%# Eval("ShipName") %>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="FirstName" runat="server" Text='<%# Bind("ShipName") %>' />
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
Shinu.
Tags
Grid
Asked by
Jin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or