?
Solved

WPF Devexpress Grid Update

Posted on 2014-03-31
1
Medium Priority
?
282 Views
Last Modified: 2014-10-05
Hi Experts,
I am using devexpress in my WPF application.
I have a dxg:Grid which is bound using linq. Now I want to update the records to database.

Any help is really appreciated. Thanks
MainWindow.xaml.cs
MainWindow.xaml
0
Comment
Question by:johny_bravo1
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 1500 total points
ID: 40139172
change this
private void loadCustomers()
        {
            bool? deleted = false;
            callDBDataContext cd = new callDBDataContext();
            var customers = (from p in cd.TblCustomers
                             where p.IsDeleted == deleted
                             select new { p.CustomerId, p.CustomerName, p.CustomerAddress, p.ContactNo1, p.ContactNo2, p.DateOfBirth, p.Anniversary, p.IntroducerName, p.IntoducerContactNo });

            l = cd.TblCustomers.GetNewBindingList();
            gridControl1.ItemsSource = customers;

        }

Open in new window


to

private void loadCustomers()
        {
            bool? deleted = false;
            var customers = (from p in dc.TblCustomers
                             where p.IsDeleted == deleted
                             select new { p.CustomerId, p.CustomerName, p.CustomerAddress, p.ContactNo1, p.ContactNo2, p.DateOfBirth, p.Anniversary, p.IntroducerName, p.IntoducerContactNo });

            l = dc.TblCustomers.GetNewBindingList();
            gridControl1.ItemsSource = customers;

        }

Open in new window

0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question