in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Insert in ASPxGridView failed

Last post 10/12/2007 6:53 AM by Mehul Harry (Developer Express). 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 10/10/2007 8:44 AM

    Insert in ASPxGridView failed

    Hi,
    I put a button in the header of the ASPxGridView ti insert a new record. The button execute this stament:

    protected void btnStorageSpaceMapNew_Click (object sender, EventArgs and)
    {
    ASPxGridViewStorageSM.AddNewRow ();
    }

    A form was displayed on the GridView but i saw the key fields of the table was protected. Why?
    I wrote my data in the editable fields but when click on update I had the following message (for obvious reasons)

    Cannot insert the value NULL into column “PrimaryCode”, table “DRAMS.dbo.PRIMARYCODES”; column does not allow nulls. INSERT fails. The statement has been terminated.

    How I resolve this problem? Why the key fields was protected?
  • 10/12/2007 6:53 AM In reply to

    Re: Insert in ASPxGridView failed

    Hello Aldo,

    First, I would recommend to use the client side event for adding. Take a look at this tutorial's status bar:

    Switch to the edit mode by clicking a status bar button or by double-clicking a row

    As for protected fields, you can check to see if the Column is set to ReadOnly.

    Thanks.

    Filed under:
Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED