This is a migrated thread and some comments may be shown as answers.

[Solved] Delete row

3 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Denis
Top achievements
Rank 1
Denis asked on 18 Oct 2010, 06:52 AM
Hi!
I am using this code:

public OraDomainContext ctx = new OraDomainContext();
        public MainPage()
        {
            InitializeComponent();
            LoadOperation<People> LoadOperation = ctx.Load(ctx.GetPeoplesQuery());
            LoadOperation.Completed += new EventHandler(LoadOperation_Completed);
        }
 
        void LoadOperation_Completed(object sender, EventArgs e)
        {
            radGridView1.ItemsSource = ctx.Peoples;
        }
 
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ctx.Peoples.Remove(radGridView1.SelectedItem as People);
            ctx.SubmitChanges();
        }

When this code execute it shows that row is deleted, but when i refresh page then i can see that row again. Please help me


3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 21 Oct 2010, 05:36 PM
Hello Denis,

 Can you please confirm that when the actual remove operation is done your Peoples collection is correctly populated? If the collection is not populated on time your delete might not correctly propagate to the server.
Please put a break point here:

ctx.Peoples.Remove(radGridView1.SelectedItem as People);
and assure that the peoples collection is not empty.


Greetings,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Denis
Top achievements
Rank 1
answered on 22 Oct 2010, 07:47 AM
I checked that - peoples collection is not empty.
In the console project deleting is executed, but in the Silverlight application is not.
The problem in the RIA Services?
0
PetarP
Telerik team
answered on 27 Oct 2010, 06:02 PM
Hello Denis,

 Basically the peoples collection is loaded asynchronously. The only problem I can see here is if the delete occurs before the collection has been loaded. This would result in removing the entry from the grid but not from the database. Are you sure that this is not the case here? 

Kind regards,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Denis
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Denis
Top achievements
Rank 1
Share this question
or