User (Old forums)MemberJune 18, 2007 at 6:41 amPost count: 23064
I was able to follow the docs and create a DataTable DefaultView , use that in creating a datagridcollectionview source, and if i add items to the table they are shown in the grid. I just have some questions from here
1) there is an insertion row, and i can edit existing items, but i don’t see a default ‘delete’ command, if i highlight a row (vis athe left margin) and hit delete nothing happens, where can i add this functionality?
2) How do i actually call the update methods on the datatable/view to update the underlying database?
This is in C#, VS2005 (or Orcas) as i’m testing in both.
Imported from legacy forums. Posted by rwo123gr (had 2430 views)User (Old forums)MemberJune 18, 2007 at 1:49 pmPost count: 23064
/// Interaction logic for LocationEditor.xaml
public partial class LocationEditor : System.Windows.Controls.Page
private BindingSource bindingSource;
private WPL_SDFDataSet dataSet = new WPL_SDFDataSet();
private WPL_SDFDataSetTableAdapters.LocationsTableAdapter lta = new LocationsTableAdapter();
this.dataSet = new WPL_SDFDataSet();
this.bindingSource = new BindingSource();
this.dataSet.DataSetName = “locationDataSet”;
this.bindingSource.DataMember = “Locations”;
this.bindingSource.DataSource = this.dataSet;
this.LocationDataGridControl.ReadOnly = false;
this.LocationDataGridControl.ValidationMode = ValidationMode.RowEndingEdit;
this.LocationDataGridControl.AutoCreateColumns = true;
//DataGridCollectionView dataGridCollectionView = new DataGridCollectionView(dv);
this.LocationDataGridControl.DataContext = this.bindingSource;
this.LocationDataGridControl.ItemsSource = this.bindingSource;
this.LocationDataGridControl.Columns[“LocationID”].Visible = false;
this.LocationDataGridControl.Columns[“Name”].Title = “Location Name”;
Imported from legacy forums. Posted by rwo123gr (had 275 views)Xceed SupportMemberJune 19, 2007 at 8:51 amPost count: 5658
1) There is no delete functions packaged in the DataGridControl. We wanted to let the user determine their own logic for deletion… Using the “search” link on the top of the page, you can find several examples on how to achieve this feature.
2) Update to the Database need to be done according to your application’s logic, at your convenience… You can refer to the ADO.NET documentation for details on how to update the database once the dataset was modified.
Imported from legacy forums. Posted by Marcus [Xceed] (had 3418 views)
- You must be logged in to reply to this topic.