UI controls for ASP.NET AJAX, MVC, WPF,Silverlight, Windows 8 and Windows Phone
Cross-platform Mobile Development Toolwith cloud-based architecture
Everything you need to build sites andmobile apps with JavaScript and HTML5
One easy tool for Functional, Performance,Load and Mobile software testing
Everything for your online business - contentmanagement, ecommerce, emarketing
Simple and intuitive project managementand collaboration software
Change Edit Mode:
This example illustrates how automatic insert, update and delete data operations can be achieved with RadTreeList and all ASP 3.5 DataSource control types:
What you need to do is to set the following properties:
The RadTreelist control expects the key to be incremented when you insert items, therefore the new items are located at the bottom of the group.
You may also see how to utilize Telerik OpenAccess ORM as a data access layer for our AJAX controls by visiting the OpenAccess ORM live demos here.
<%@ Page Language="c#" CodeFile="~/TreeList/Examples/DataEditing/Net35AutomaticDataEditing/DefaultCS.aspx.cs"Inherits="Telerik.Web.Examples.TreeList.DataEditing.NET35AutomaticDataEditing.DefaultCS" %> <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>ASP.NET TreeList Demo - NET 3.5 automatic data editing</title> <style type="text/css"> .MyImageButton { cursor: pointer; } </style> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" /> <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" /> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel> <telerik:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" runat="server"> <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configurator" Expanded="true"> <p> <label for="RadioButtonList1"> Change Edit Mode:</label> </p> <div style="float: left;"> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" RepeatDirection="Horizontal"> <asp:ListItem Text="In-forms editing mode" Value="EditForms" Selected="True"></asp:ListItem> <asp:ListItem Text="In-line editing mode" Value="InPlace"></asp:ListItem> <asp:ListItem Text="Pop-up editing mode" Value="PopUp"></asp:ListItem> </asp:RadioButtonList> </div> <div style="float: left; margin-left: 70px; margin-top: 3px;"> <asp:CheckBox ID="CheckBox1" runat="server" Checked="false" Enabled="false" Text="Modal PopUp edit form" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged"></asp:CheckBox> </div> </qsf:ConfiguratorPanel> <h2 class="qsfSubtitle">LinqDataSource </h2> <telerik:RadTreeList runat="server" ID="RadTreeList1" DataSourceID="LinqDataSource1" AllowPaging="true" PageSize="5" DataKeyNames="ID" ParentDataKeyNames="ParentID" AutoGenerateColumns="false"> <Columns> <telerik:TreeListEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" HeaderStyle-Width="80px"> <ItemStyle CssClass="MyImageButton"></ItemStyle> </telerik:TreeListEditCommandColumn> <telerik:TreeListButtonColumn UniqueName="DeleteCommandColumn" Text="Delete" CommandName="Delete" HeaderStyle-Width="40px" ButtonType="ImageButton"></telerik:TreeListButtonColumn> <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="ID" ReadOnly="true"></telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="FullName" UniqueName="FullName" HeaderText="Name"></telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="Parent ID" ReadOnly="true"></telerik:TreeListBoundColumn> </Columns> </telerik:RadTreeList> <br /> <h2 class="qsfSubtitle">EntityDataSource </h2> <telerik:RadTreeList runat="server" ID="RadTreeList2" DataSourceID="EntityDataSource1" AllowPaging="true" PageSize="5" DataKeyNames="id" ParentDataKeyNames="parentId" AutoGenerateColumns="false"> <Columns> <telerik:TreeListEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" HeaderStyle-Width="80px"> <ItemStyle CssClass="MyImageButton"></ItemStyle> </telerik:TreeListEditCommandColumn> <telerik:TreeListButtonColumn UniqueName="DeleteCommandColumn" Text="Delete" CommandName="Delete" HeaderStyle-Width="40px" ButtonType="ImageButton"></telerik:TreeListButtonColumn> <telerik:TreeListBoundColumn DataField="id" UniqueName="id" HeaderText="ID" ReadOnly="true"></telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="Text" UniqueName="Categories" HeaderText="Categories"></telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="parentid" UniqueName="parentid" HeaderText="Parent ID" ReadOnly="true"></telerik:TreeListBoundColumn> </Columns> </telerik:RadTreeList> </telerik:RadAjaxPanel> <asp:LinqDataSource runat="server" ID="LinqDataSource1" ContextTypeName="LinqToSql.TelerikSamplesDataContext" TableName="Employees" EnableUpdate="true" EnableInsert="true" EnableDelete="True"> </asp:LinqDataSource> <asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=TelerikEntities35" DefaultContainerName="TelerikEntities35" EntitySetName="Links" EnableInsert="True" EnableUpdate="True" EnableDelete="True"> </asp:EntityDataSource> </form> </body> </html>