Home Forums WinForms controls Xceed Grid for WinForms Save after edition

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17051 |

    I need to save the content of a cell, on Lost focus of that cell. I am binding data source to grid as follows. Where ‘dt’ is a DataTable

                        gcDoc.DataSource = dt;

     

     

     

     

     

    Imported from legacy forums. Posted by bdmsoft (had 1825 views)

    User (Old forums)
    Member
    Post count: 23064

    Use the EditLeft event on DataCell or the CurrentCellChanged event on GridControl.

    e.g.:

        private void Form1_Load( object sender, EventArgs e )
        {
          foreach( Cell cell in dataRowTemplate1.Cells )
          {
            cell.EditLeft += new EditLeftEventHandler(cell_EditLeft);
          }
          gridControl1.CurrentCellChanged += new EventHandler( gridControl1_CurrentCellChanged );
        }

        void cell_EditLeft( object sender, EditLeftEventArgs e )
        {
        }

        void gridControl1_CurrentCellChanged( object sender, EventArgs e )
        {
        }

    Imported from legacy forums. Posted by André (had 1609 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    Thank you for quick reply.

    Event is OK, I need to know how to get the modified Row information to save. Or else do I need to update whole DataSet

     – Regards

    Imported from legacy forums. Posted by bdmsoft (had 1616 views)

    User (Old forums)
    Member
    Post count: 23064

    What do you mean by “get the modified Row information to save”?  Do you want to update the database from which the DataSet is filled?  If so, you simply need to call the Update() method on the data adapter (the same adapter you use to fill the DataSet using the Fill() method).  You also need to call AcceptChanges() on the DataSet or on the DataRow that was modified.

    If you mean something else, please provide more information.

    Imported from legacy forums. Posted by André (had 2214 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.