Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Error on WebDataGrid control
posted

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

Parents
  • 33839
    Suggested Answer
    posted

    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 

  • 80
    posted in reply to [Infragistics] 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.

    Best Regards,

    Sabarees.M

Reply Children
No Data