Hi,
I've set some properties in the webdatagrid to enable manual CRUD. When I click on a new row after editing the data I get this error message.
I've not implemented any update code yet though? Only some code to see if the values where being passed to the server.Any ideas what the grid is looking for?DataKeyFields=Doc_IdBinding is programatic on load of the page.
lbErrorMsge.Text =
"Updating Doc_Id: " + e.Values("Doc_Id").ToString + ", Invoice_Type: " + e.Values("Invoice_Type").ToString
Table doesn't have a primary key.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.MissingPrimaryKeyException: Table doesn't have a primary key.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[MissingPrimaryKeyException: Table doesn't have a primary key.] Infragistics.Web.UI.Framework.Data.DataViewDataSourceAdapter.Update(Object dataItem, IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +1388 Infragistics.Web.UI.Framework.Data.DataSourceObjectView.Update(Object dataItem, IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +62 Infragistics.Web.UI.GridControls.EditingCore.OnAction(String actionType, Object id, Object value, Object tag) +3198 Infragistics.Web.UI.GridControls.GridBehavior.Infragistics.Web.UI.GridControls.IGridBehavior.OnAction(String actionType, Object id, Object value, Object tag) +48 Infragistics.Web.UI.GridControls.GridBot.LoadAdditionalClientState(Object state) +670 Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +205 Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent() +75 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +34 System.Web.UI.Page.RaiseChangedEvents() +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Ok added a PK to the table and now ok.
Protected Sub WebDataGrid1_RowUpdating
is not being called after an edit and a new row selection?
Anyone know why?
Thank you.
RowUpdating now being called but after it has been issued I get this error:
Also had to put a PK on the dataset I had opened.