Hi, here I have created the datatable dt,and attached to datasource i.e ultraGrid1.datasource =dt so,i dont have any dadadapter or dataset,so how can i save the data in the ultragrid drag and droped rows on the button click event.
Hello,
Thank you for contacting Infragistics Support.
In order to save changes you have made to your UltraGrid you need to call its UpdateData method. This method will update any modified information in the grid, sending it to the data provider. More about UpdateData methos you may find by following the next link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v14.2~Infragistics.Win.UltraWinGrid.UltraGridBase~UpdateData.html. You can also set when the grid will update its data source by setting UpdateMode property of the grid. More about this property you may find by following the next link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v14.2~Infragistics.Win.UltraWinGrid.UltraGrid~UpdateMode.html
Please note the grid only deals with its local DataSource, and the DataSource only get updates by the grid when something changes. When dealing with the DataSource and the back end (the database), the grid doesn't really have any involvement there. If you need to save the changes you have made in DataTable you need to use some back end. Please find attached sample where I have implemented saving the changes from UltraGrid to DataTable. Additionally when you click “Save Data To XML” button DataTable will be saved in XML file.
Please let me know if this is what you are looking for or if I am missing something.
hi,i have tried like this
{DataTable dt = new DataTable(); dt.Columns.Add("CustomerName",typeof(string)); dt.Columns.Add("CustomerID", typeof(int));
ultragrid1.Datasource=dt; }
private void ultraButton1_Click(object sender, EventArgs e) {
this.ultraGrid1.UpdateData(); DataTable dt = (DataTable)this.ultraGrid1.DataSource; }
created the data table dt,and performed drag and drop operation ,now on click of button data should save in ultragrid.
plzz help me to get the problem resolve