Ticket T1282511
Visible to All Users

ASPXGridView Master-Detail with inline edit and custom errors

created 2 days ago (modified 2 days ago)

I have a master-detail gridview. The master is editable; the detail is not. I have validation rules that require accessing the database, so I have a row validation event handler server-side. This can produce custom error messages, that I show in the error row at the bottom of the edit form. This works ok if the edit form is in a pop-up, or if SettingsEditing-Mode is "edit form".

There are only three editable fields, so I would like to change the editing mode to inline.

I cannot find an example of how to deal with server-side (custom) error messages when editing inline and there is already a detail row as part of a master/detail grid. I have seen an example using a detail row that becomes visible if error text is put into it, but the "Detail" tag in the aspx does not allow an ID so I have not been able to work out server-side which detail row is which.

I have two work-arounds; (i) stay with the edit form, or (ii) update via a stored procedure and raise an error from there. Neither is elegant. "Raiserrror" messages from the database do appear below the inline row being edited, so there is some hidden row facility there; I just cannot work out how to access it from the code-behind.

I thought I had it solved, but "Value cannot be null. Parameter name: key'" was the result. The row number does not appear to be in context.

I'll later have to solve the same problem for batch editing; I have a master-detail gridview elsewhere where batch editing of the master, or the detail, would be appropriate. Fortunately, there is no requirement to batch-edit both at the same time.

Comments (1)

    I have found an example in github that is similar and let me find my error (I was referencing the wrong gridview)

    https://github.com/DevExpress-Examples/asp-net-web-forms-grid-implement-custom-date-validation-in-batch-edit-mode

    You may close this ticket; I'll raise a new ticket if I don't make any progress.

    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.