Hi Friends,
I had a below error when implementing WebDataGrid control in replace of UltraWebGrid control in our application. While entering numeric values to the WebDataGrid column then immediatly after that, attached screen will appear.
"Async request failed". "A row can only updated or deleted if the DataKeyFields property is set."
Kindly refer the below image and suggest me to rectify this error and proceed further on this.
Best Regards,
Sabarees.M
Hi Sabarees.M,
As the error says, you did not set the DataKeyFields property on the WebDataGrid itself. The WebDataGrid is not unbound. It is bound to the datasource and thus requires its primary key in order to update it properly.
regards,David Young
Hi David,
Thanks for your response. Now I have applied the DataKeyFields in my WebDataGrid control. but after that it thrown the below error.
Below is my WebDataGrid design code:
<ig:WebDataGrid ID="UWGStartingBalances" AltItemCssClass="AltRowStyle" CssClass="NormalRowStyle" runat="server" Width="570px" Height="350" DataKeyFields="AccountID" TabIndex="2" ClientEvents-MouseDown="UWGStartingBalances_MouseDownHandler" AutoGenerateColumns="false"> <Columns> <ig:BoundDataField DataFieldName="AccountID" Header-Text="AccountID" Header-CssClass="GridHeaderStyle" CssClass="NormalTemplateRight" Key="AccountID"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Account" CssClass="NormalTemplateLeft" Header-CssClass="GridHeaderStyle" Header-Text="Account" Key="Account"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Starting Balance" Header-Text="Starting Balance" Header-CssClass="GridHeaderStyle" CssClass="NormalTemplateRight" Key="Starting Balance"> </ig:BoundDataField> </Columns> <Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing Enabled="true" EditCellCssClass="Edit"> <CellEditingClientEvents ExitedEditMode="UWGStartingBalances_AfterExitEditModeHandler" /> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Account" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> <EditingClientEvents /> </ig:EditingCore> <ig:VirtualScrolling ScrollingMode="Deferred" Enabled="true"> </ig:VirtualScrolling> <ig:Selection CellSelectType="Multiple" ColumnSelectType="Multiple" EnableCrossPageSelection="true" RowSelectType="Multiple"> </ig:Selection> </Behaviors> </ig:WebDataGrid>
Kindly suggest me to proceed further.
Um, you don't actually have any error screenshot or error text attached, so I couldn't begin to guess. At a glance, your source code looks fine. Of course, your code behind could be doing something.
-Dave
Hi Dave,
Now I hope you got the error screenshot. Please refer it and let me know any suggestions.
Thanks,
People seem to see that very often. It is usually due to the grid not having its datasource before updating. It tries to find the updated row for event firing before updating in the source. Make sure you've reassigned your data source perhaps.