Batch EditMode and Nested/Detail Templates

1 posts, 0 answers
  1. josh
    josh avatar
    1 posts
    Member since:
    Feb 2017

    Posted 09 Feb 2017 Link to this post

    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>
Back to Top