We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridControl and DataSource

Hi, I am new to the Essential Grid stuff. I have a couple of questions. 1. How do I use a DataTable object with a GridControl? The DataTable object is created from an XML file. I'd like to have the same behavior like to the DataSet and DataGrid objects in the .NET framework. In addition, I want to be able to undo/redo things. The latter is the whole reason I bought the Essential Grid stuff. Microsoft's DataGrid and DataSet objects have worked very well for me until I need this undo/redo thing. Is there any way to automatically add a new row to the data grid when I enter data in the current row just like the Microsoft stuff? 2. Is the undo/redo capability also available in the GridDataBoundGrid object? It seems that the GridDataBoundGrid is more or less like the DataGrid object in the .NET framework. But how can I have undo/redo capability? Thanks Sam

2 Replies

AD Administrator Syncfusion Team August 21, 2003 10:40 AM

> Hi, I am new to the Essential Grid stuff. I have a couple of questions. > > 1. How do I use a DataTable object with a GridControl? The DataTable object is created from an XML file. I'd like to have the same behavior like to the DataSet and DataGrid objects in the .NET framework. In addition, I want to be able to undo/redo things. The latter is the whole reason I bought the Essential Grid stuff. Microsoft's DataGrid and DataSet objects have worked very well for me until I need this undo/redo thing. Is there any way to automatically add a new row to the data grid when I enter data in the current row just like the Microsoft stuff? > > 2. Is the undo/redo capability also available in the GridDataBoundGrid object? It seems that the GridDataBoundGrid is more or less like the DataGrid object in the .NET framework. But how can I have undo/redo capability? > > Thanks > Sam > 1) You have two options. You can actually move the data from the DataTable to the GridControl, say using the PopulateValues method on the grid. (See the Syncfusion\Essential Suite\Grid\Samples\In Depth\GridPopulationSample for some code using this method). Or, you could use the grid in a virtual mode, where you handle QueryCellInfo, QueryColCount, QueryRowCount and maybe SaveCellInfo to provide the data from the datatable to the grid on demand. (Check section 4.3 in the users guide for more info on virtual grids). 2) In a GridDataBoundGrid, you can get at the CopmmandStack to enable undo through the Model property. this.gridDataBoundGrid1.Model.CommandStack.Enabled = true;


SH Shulin He August 25, 2003 10:55 AM

Thanks for the info. I have got it work by using GridDataBoundGrid. Sam > > Hi, I am new to the Essential Grid stuff. I have a couple of questions. > > > > 1. How do I use a DataTable object with a GridControl? The DataTable object is created from an XML file. I'd like to have the same behavior like to the DataSet and DataGrid objects in the .NET framework. In addition, I want to be able to undo/redo things. The latter is the whole reason I bought the Essential Grid stuff. Microsoft's DataGrid and DataSet objects have worked very well for me until I need this undo/redo thing. Is there any way to automatically add a new row to the data grid when I enter data in the current row just like the Microsoft stuff? > > > > 2. Is the undo/redo capability also available in the GridDataBoundGrid object? It seems that the GridDataBoundGrid is more or less like the DataGrid object in the .NET framework. But how can I have undo/redo capability? > > > > Thanks > > Sam > > > > 1) You have two options. > > You can actually move the data from the DataTable to the GridControl, say using the PopulateValues method on the grid. (See the Syncfusion\Essential Suite\Grid\Samples\In Depth\GridPopulationSample for some code using this method). > > Or, you could use the grid in a virtual mode, where you handle QueryCellInfo, QueryColCount, QueryRowCount and maybe SaveCellInfo to provide the data from the datatable to the grid on demand. (Check section 4.3 in the users guide for more info on virtual grids). > > 2) In a GridDataBoundGrid, you can get at the CopmmandStack to enable undo through the Model property. > > this.gridDataBoundGrid1.Model.CommandStack.Enabled = true; >

Loader.
Live Chat Icon For mobile
Up arrow icon