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

RowsChanging - Event does not fire

1 Answer 258 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andreas Haeusler
Top achievements
Rank 2
Andreas Haeusler asked on 20 Sep 2015, 06:28 PM

Hello,

 

I'm experiencing some problems with a gridview bound to a bindingsource (using entity framework 5).

The RowsChanging event does not fire on binding operations, neither on the initial binding nor on any subsequent reloading of data. The RowsChanged event does. To my understanding before every RowsChanged event, the RowsChanging event should fire at least once.

 

I tried using the gridview.Rows.CollectionChanging event, but it does not exist - though it should according to the documentation.

 

The event DOES fire if I modify the​ rows at runtime (like removing one row).

 

simplified version of the code (tried variations of binding to the MasterTemplate, with or without BeginEdit etc):

 

Kind regards,

Andreas

 

public RadForm1()
{
    InitializeComponent();
    radGridView1.RowsChanging += RadGridView1OnRowsChanging;          
    bs = new BindingSource {DataSource = context.Sonderthema_Art.ToList()};
    radGridView1.DataSource = bs;
}
 
 
private void RadGridView1OnRowsChanging(object sender, GridViewCollectionChangingEventArgs gridViewCollectionChangingEventArgs)
{
    throw new NotImplementedException();
}

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Sep 2015, 07:51 AM
Hello Andreas,

Thank you for writing.

When setting the RadGridView.DataSource property, only the RowsChanged event is supposed to be fired. As to the RowsChanging event, it is fired only when you manually add/delete rows from the because you can cancel this operation. When you add/delete an item from the BindingList or set the DataSource, this fires only the RowsChanged event and you are not allowed to cancel this operation.

Since Q2 2010 (version 2010.2.10.713) the Rows. event has been removed. We will update the online documentation.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Andreas Haeusler
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or