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

Batch EditMode and Nested/Detail Templates

0 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
josh
Top achievements
Rank 1
josh asked on 09 Feb 2017, 05:14 PM

Hello,

I have a grid in batch edit/cell mode, and everything works.

My problem is that one of the fields is very large - potentially two or three paragraphs of text. I'd like to move this onto it's own row, if possible. I've tried using a radtextbox within a NestedViewTemplate and DetailItemTemplate, and I can get the data to display in both, but I can't figure out how to include it in batch saves. <%#Bind("FieldName")%> doesn't work. 

What would be the best way to accomplish this?

Here's a sample of what I have:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="true" AutoGenerateColumns="false" DataSourceID="DataSource1">
     <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ItemNumber" EditMode="Batch" AutoGenerateColumns="false" 
        DataSourceID="DataSource1">
        <BatchEditingSettings EditType="Cell" HighlightDeletedRows="true" />
        <NestedViewTemplate>
             <telerik:RadTextBox ID="txtDesc" runat="server" Text='<%#Bind("Desc")%>' />
         </NestedViewTemplate>
         <Columns>
             <telerik:GridBoundColumn UniqueName="ItemNumber" DataField="ItemNumber" HeaderText="Item Number" />
         </Columns>
     </MasterTableView>
 </telerik:RadGrid>
 <asp:SqlDataSource runat="server" ID="DataSource1" ConnectionString="(ConnectionString)" ConflictDetection="OverwriteChanges"
     SelectCommand="SELECT * FROM [Table]"
     InsertCommand="INSERT INTO [Table] ([Name], [Desc]) VALUES (@Name, @Desc)"
     UpdateCommand="UPDATE [Table] SET [Name]=@Name, [Desc]=@Desc WHERE [ItemNumber]=@ItemNumber">
     <InsertParameters>
         <asp:Parameter Name="Name" Type="String" />
         <asp:Parameter Name="Desc" Type="String" />
     </InsertParameters>
     <UpdateParameters>
         <asp:Parameter Name="Name" Type="String" />
         <asp:Parameter Name="Desc" Type="String" />
         <asp:Parameter Name="ItemNumber" Type="Int32" />
     </UpdateParameters>
 </asp:SqlDataSource>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
josh
Top achievements
Rank 1
Share this question
or