Listview itemupdating event not firing
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.When I click the "Update" buttom (that is, the button to commit the changes - the one that should trigger the "Update" event), all it does on postback is the Page_Load event (which is empty). Please review the following specific error details and modify your source code appropriately. This answer you could have easily found in the link I provided on the Item Command event. The Item Command event will only fire when a button inside a List View is clicked.Now click on Edit button you will see the following output.List is displayed properly and all the data is shown correctly.Hi, I have a Rad List View where I am dynamically creating the layout template and insert template at runtime.
But when user clicks on the update button, it doesn't fire the Item Command event handler. When the control is loaded dynamically, should I have to register the event handlers again?
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.
Also it might depend how exactly you wire up the event handlers and in which event in code or markup you do this.
You can verify that after the listview goes in edit mode the Item Command event is still attached as expected.