In this article, I’ll provide a developer’s perspective of the control, and show in action both its obvious and less obvious capabilities and features.The primary aspect of the List View control is that it allows you to take full control of the user interface via templates and properties.
The Details View control allows you to insert, edit and delete records.
Building the Sample Description Initially, I have loaded data from a database to details view, each record is displayed in the details view of each page.
After each update we wait 5 seconds to make sure event receivers finish previous event before to handle next one.
If this is not needed for your scenario or if event receivers work faster you may comment or decrease number of seconds to wait.
I'm not certain how to get the button to use that Item Updating event of the listview control... This is what my page looks like at the moment: Item Updating is not the correct event to be using with a button control in a List View, this is used for two-way binding of the List View. Compiler Error Message: CS0123: No overload for ' List View1_Item Command' matches delegate ' System. This answer you could have easily found in the link I provided on the Item Command event. The MSDN Library, frankly, is not beginner friendly. This post has been edited by KCross: 05 March 2010 - PM It is no trouble, really. I wasn't trying to be hard on you, just saying you need to read carefully.
Item Command" Delete Command="DELETE FROM [Black Berry] WHERE [PIN] = @PIN" Insert Command="INSERT INTO [Black Berry] ([PIN], [Phone Number], [Model], [OS], [Carrier], [Status], [Current User], [Check Out Date]) VALUES (@PIN, @Phone Number, @Model, @OS, @Carrier, @Status, @Current User, @Check Out Date)" Select Command="SELECT * FROM [Black Berry] WHERE ([Status] = @Status)" Update Command="UPDATE [Black Berry] SET [Phone Number] = @Phone Number, [Model] = @Model, [OS] = @OS, [Carrier] = @Carrier, [Status] = @Status, [Current User] = @Current User, [Check Out Date] = @Check Out Date WHERE [PIN] = @PIN" I included Main.simply because on a postback, it does the Page_Load event of BBCheck cs, then Main. So I need to write a custom event for all actions that could occur within the List View? And I would highly suggest you let the designer generate the event declarations for you instead of hand coding them.
The output of the List View control can be styled at leisure but only using CSS style sheets directly on HTML elements and without the intermediation of ASP. As mentioned, the List View control doesn’t force you to stick to a predefined layout – be it tabular, grid, multi-column.
From what I understand, I need to modify the event to basically say, on a Button Click event, if Command Name="Update" then [do x]. I can't create a button click event in the traditional way. I wanted to include all code that is processed during run-time. When I try to use On Item Command="List View1_On Item Command" (or "List View1_Item Command") I get this: Server Error in '/' Application. At least until you have a good understanding of events.