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

EditItemTemplate not working

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shivam
Top achievements
Rank 1
Shivam asked on 19 Dec 2013, 09:27 PM
I am trying to use EditItemTemplate in RadGrid but I am unable to do it as the page comes back with just the 'RadTextBox' instead of full grid. Attached is the image of the result I get while using EditItemTemplate. If I remove <EditItemTemplate> bit everything works fine. I just want to use my own custom controls in RadGrid while editing / inserting items. Following is the code I am using. Please help me with this issue. Can't work out this issue as this should be simple enough.

<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"

AllowAutomaticInserts="True" PageSize="10" Skin="Default" AllowAutomaticUpdates="True" AllowPaging="True"

AutoGenerateColumns="False" Width="750px" DataSourceID="SqlDataSource_nonCot">

<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ItemID"

DataSourceID="SqlDataSource_nonCot" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">

<BatchEditingSettings EditType="Cell" />

<SortExpressions>

<telerik:GridSortExpression FieldName="ItemID" SortOrder="Descending" />

</SortExpressions>

<Columns>

<telerik:GridBoundColumn DataField="ItemID" HeaderStyle-Width="210px" HeaderText="ItemID" SortExpression="ItemID"

UniqueName="ItemID">

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="ItemTypeID" HeaderStyle-Width="180px" UniqueName="ItemTypeID" DataField="ItemTypeID">

<ItemTemplate>

<%# Eval("ItemTypeID") %>

</ItemTemplate>

<EditItemTemplate>

<telerik:RadTextBox ID="txt_itemID" runat="server" />

</EditItemTemplate>

</telerik:GridTemplateColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>




1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Dec 2013, 04:47 AM
Hi Shivam,

I tried your code and it works fine at my end. Can you try this demo on Grid - Batch Editing and check if you can find the difference with your code. Please also try using Advanced Data-binding (using NeedDataSource event) for binding the radgrid.

Thanks,
Princy
Tags
Grid
Asked by
Shivam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or