Using ASP.NET 3.5's ListView and DataPager Controls: Inserting Data

Posted by: 4GuysFromRolla.com Headlines, on 17 Jun 2009 | View original | Bookmarked: 0 time(s)

The ListView control is similar to the GridView control in many ways: both display a set of records, both support built-in sorting, paging, editing, and deleting functionality with minimal effort. The ListView differs from the GridView in two key ways:

  • Rather than using fields, the ListView is rendered via templates, which offers the page developer much finer control over the emitted markup, and
  • The ListView supports built-in inserting support

The first installment in this series explored the ListView's template-based rendering. This installment looks at how to use the ListView's inserting functionality.

In a nutshell, inserting data from the ListView requires two steps: defining the inserting interface via the InsertItemTemplate and specifying where the inserting interface should go via the InsertItemPosition property. Much like with editing data from within the ListView, the InsertItemTemplate can contain two-way databinding statements when using a data source control to get the inputs entered by the user from the ListView's inserting interface into the parameters of the data source control. And like with the editing and deleting workflows, you can programmatically examine and modify the user's submitted data before inserting the data, cancelling the operation altogether if needed.

This article walks through the steps for creating a ListView that allows users to insert records. It also shows how to optionally cancel the inserting workflow based on programmatic logic. Read on to learn more!

(It is assumed that the reader is familiar with how to insert data using a data source control. If this is not the case, please first read Accessing and Updating Data in ASP.NET: Inserting Data.)
Read More >

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: DataSet | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2663 | Hits: 55

Similar Posts

  • Introducing Versatile DataSources more
  • How to display data from different tables using one data source more
  • Choose your preferred data layout with RadListView for ASP.NET AJAX more
  • Building a class browser with Microsoft Ajax 4.0 Preview 5 more
  • ASP.NET AJAX 4.0 Preview 5 released to CodePlex more
  • Self-reference hierarchy with Telerik TreeView for Silverlight more
  • Using Microsoft's Chart Controls In An ASP.NET Application: Plotting Chart Data more
  • Silverlight Release History : Q2 2009 (version 2009.2.701) more
  • WPF Release History : Q2 2009 (version 2009.2.701) more
  • Improving Dynamic Data with Peter's Data Entry Suite more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD