Solved

WPF Devexpress Grid Update

Posted on 2014-03-31
1
211 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now