Current filter:
                                You should refresh the page.
                                  • Description:
                                    I am using the ASPxGridView connected to the LinqServerModeDataSource. As you know, it does not allow us to edit data. However, I must support data editing. How this can be done?

                                    Answer:
                                    I'd like to pay your attention to the fact that now LinqServerModeDataSource allows one to perform CRUD operations out of the box. This article is obsolete.

                                    This can be very easily implemented using the LinqServerModeDataSource, in conjunction with a companion DataSourceControl supporting data modification operations. First, we will explain how the ASPxGridView works. When the Update (Delete) button is clicked, a gridView calls the Update (Delete, Insert) command of its underlying DataSource. If you try to click this button when the ASPxGridView is connected to the LinqServerModeDataSource, the "Specified Method is Not Supported" exception will be triggered and the ASPxGridView will show you this text in the EditForm's error row. This happens because LINQ defines the query language. It does not define how data modifications should be performed.
                                    The idea is simple - delegate data modification operations to the additional data source. I.e. you should

                                    1. Handle the ASPxGridView's RowUpdating, RowInserting, RowDeleting events;
                                    2. Prevent the ASPxGridView from trying to process modifications itself;
                                    3. Delegate data modification operations to this additional data source.
                                    Here is the code showing how to implement data modifications, using the LinqDataSource ability to perform modifications for LinqToSql Linq implementation:
                                    [C#]
                                    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { LinqDataSource1.Update(e.Keys, e.NewValues, e.OldValues); e.Cancel = true; ASPxGridView1.CancelEdit(); } protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { LinqDataSource1.Insert(e.NewValues); e.Cancel = true; ASPxGridView1.CancelEdit(); } protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { LinqDataSource1.Delete(e.Keys, e.Values); e.Cancel = true; ASPxGridView1.CancelEdit(); }
                                • Stan Barnes 11.18.2014

                                  Hi There,
                                  Apologies, This is not clear to me.
                                  How do you apply a 'companion DataSourceControl' ?
                                  Is it in the ASPX page? There is only room for one datasourceID ?
                                  Many Thanks
                                  s.

                                • Luke (DevExpress) 11.18.2014

                                  Hello Stan,

                                  I'd like to pay your attention to the fact that now LinqServerModeDataSource allows one to perform CRUD operations out of the box. This article is obsolete.
                                  Should you have further questions, feel free to ask.

                                  Best Regards,
                                  Luke

                                • yesid Tellez 12.01.2014

                                  this is not obsolete in my opinion, because your support for automatic CRUD is only allowed if you don't modify the selecting event handler when you need to filter the table's records. in fact this is being linked to me as a solution for this issue.

                                • Luke (DevExpress) 12.01.2014

                                  Hello Yesid,

                                  I see that you're already discussing this question with Artem in the context of the ASPxGridView doesn't delete records if data is assigned in the LinqServerModeDataSource.Selecting event handler thread. I kindly ask you not to post similar questions in different threads. The aforementioned ticket is currently in our processing queue, and we will update it as soon as we have any progress. Thank you for your time and cooperation.

                                  Best Regards,
                                  Luke

                                0 Solutions

                                Creation Date Importance Sort by