Click here to Skip to main content
13,044,543 members (59,697 online)
Rate this:
Please Sign up or sign in to vote.
See more:
using C1.WPF.DataGrid;
        public static OleDbConnection connection;
        public static OleDbDataAdapter da;       
        public static DataSet ds = new DataSet();
        public static DataTable dt;
        OleDbCommandBuilder cmd;
        public static string connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:/Project/A&T.accdb";
        public static string cmdstring;
        private void button1_Click(object sender, RoutedEventArgs e)
            cmdstring = "SELECT*FROM DP";
            connection = new OleDbConnection(connectionstring);
            da = new OleDbDataAdapter(cmdstring, connection);
            dt = new DataTable();
            c1DataGrid1.DataContext = dt;    
        private void button2_Click(object sender, RoutedEventArgs e)

            cmd = new OleDbCommandBuilder(da);
            if (dt.GetChanges() != null)

in this code i use a third party product Component one Datagrid.the problem is while clicking Button2 the change should be updated back to the database. this is not happening.if I replace the c1DataGrid1 with Datagrid of WPF everything working fine what should i do. any sort of help will be appreciated

update is happening only when a cell in any other row is clicked . otherwise it is not happening I want to avoid this situation


Posted 4-Jan-12 2:42am
Updated 4-Jan-12 7:11am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Haven't used this control so not sure about this but should you use ItemsSource. So:
c1DataGrid1.ItemsSource= dt; 

Also many grid components have a separate method that reflects the changes in the grid to the underlying data source, so check that there isn't anything like that which should be called.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 4 Jan 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100