Solved

WPF Devexpress Grid Update

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…

839 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