Ticket Q229484
Visible to All Users

ASPxGridView - "A primary key field specified via the KeyFieldName property ..." exception is thrown when Selection is enabled

created 13 years ago

Plato,
I am sorry to report another issue. In your sample project just add the following to ASPxGridView2
<SettingsBehavior AllowSelectByRowClick="true" AllowFocusedRow="true" EnableRowHotTrack="true" />
Now try it to run the project, switching tabs, the go back to the second tab e click on the gridview2 to "select" another row, then try to switch tabs and see what happens…
I got "A primary key field specified via the KeyFieldName property is not found in the underlying data source. Make sure the field name is spelled correctly. Pay attention to the character case".
Regards,
Pedro

Comments (2)

    Hello Pedro,
    To resolve this issue, you need to specify the ASPxGridView.KeyFieldName property (if possible declaratively), which is required for selection operations. Please review the ASPxGridView.KeyFieldName Property help topic to learn more about these requirements and possible restrictions.
    A modified project is attached.
    Thanks,
    Mike
    --------------------
    Check if Search Engine is able to answer questions faster than I do!

      Thanks Mike, problem solved.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.