This question is locked. New answers and comments are not allowed.
I have a radtabstrip that contains tabs with one gridView per tab. The tabs are added and removed dynamically.
I am trying to delete selected items from a GridView in the current tab that has an ItemsSource set to a DataTable. What is the preferred way to remove the selected items?
Here is what I have so far...This is not all the code
This is how I assign the ItemsSource:
I have a button with the click event contains something like this:
Thought about trying to modify the _data variable but not sure how to associate the selecteditems back to the correct table and rows in _data.
I am trying to delete selected items from a GridView in the current tab that has an ItemsSource set to a DataTable. What is the preferred way to remove the selected items?
Here is what I have so far...This is not all the code
public ObservableCollection<
DataTable
> _data { get; set; }
This is how I assign the ItemsSource:
foreach (DataTable table in _data)
{
RadTabItem ttab = CreateTab(table.DataName);
(ttab.Content as RadGridView).ItemsSource = table;
TabControl.Items.Add(ttab);
// ttab = null;
}
I have a button with the click event contains something like this:
foreach (var row in ((TabControl.SelectedItem as RadTabItem).Content as RadGridView).SelectedItems)
{
MessageBox.Show((row.GetType().ToString()));
((TabControl.SelectedItem as RadTabItem).Content as RadGridView).Items.Remove(row as DataRow);
}
Thought about trying to modify the _data variable but not sure how to associate the selecteditems back to the correct table and rows in _data.