| | Thanks, | | Jim | What the developer really needs is a way to specify that the Data Item property of the Detail View should be populated (with the data object) when the user presses an ordinary button so that a dataobject with the values currently on screen will be available in the event handler for that button click.
The Data Item property is always always null, when I need it.
yes, when using bound Field with Default Mode = Edit Mode, we can not use Cell.
NET autogenerate | an update button, and then press update after making changes, but I don't | want that update button.
| | How can I get the updated object when the user presses one of my other | action buttons?
And if you don't want to use the buildin edit/update/cancel button, of course we can use our own buttons, we can add a custom field and put our own submit or linkbutton in it.
But we need to set the proper command Name for them such as "Edit", "Update", "Cancel" ... =" | MIME-Version: 1.0 | Content-Type: text/plain; | charset="Utf-8" | Content-Transfer-Encoding: 7bit | X-Newsreader: Microsoft CDO for Windows 2000 | Content-Class: urn:content-classes:message | Importance: normal | Priority: normal | X-Mime OLE: Produced By Microsoft Mime OLE V6.00.3790.0 | Newsgroups: microsoft.public.dotnet.framework.aspnet | NNTP-Posting-Host: TK2MSFTNGXA03gbl 10.40.2.250 | Path: TK2MSFTNGXA01gbl!
| | Thanks, | | Jim | Thanks for your response Jim, Yes ,the Date Item is used during the Data Binding period, after that , in the sequential page reuqest, it's null. Text which stored the current record's certain fields values.
So we can not retrieve the Data Object back through it in sequential postback events. For example, suppose we have the following fields in details View: ,we can use the following code to display all the values displayed in UI: protected void Button1_Click(object sender, Event Args e) we will get three rows ,each row represent a field. Also, since you're not using the buildin edit/update funciton, we can replace the boundfields with our custom template fields instead.
"Steven Cheng[MSFT]" wrote: Hi Jim, Welcome to ASPNET newsgroup. NET 2.0's Details View control , based on my research, after we perform Data Binding on the Details View, all the datas from Data Source are persisted in the Details View through View State, and they're not directly exposed to us.
Currently if we need to retrieve the Old Values and New Values and key values from the paramters collection ,the best means is utilize the details View's buildin Updating command.
So for your scenario, I think we can set the Details View's default mode to edit, use autogeneratedrows , then we can call Details View. US, VS.80)BTW, as for the the limitation you mentioned, I do agree that some of them are reasonable such as make programmatical update/edit... If using the buildin update command of the datasource is ok, you can ignore the itemupdating event.