We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Binder - Refresh

Hi, DataBoundGrid I am not sure if the following bug is mine (because I have changed the grid behavior or internal ). A grid with customer orders ( the specific customers has orders ). I click in a row . Then I change customer with another customer without orders . As I click the new empty row I receive a message "no value at index -1" I have susbcribed the grid in a DataView.ListChanged event. In case of ListChangedType.Reset I had writen Grid.Refresh and UpdateScrollBars. I corrected the mistake only when after Grid.Refresh I added Grid.Binder.SetCurrentPosition(0,false); I was expecting with Refresh to update and the Binder. May be is my mistake due to changes I have done but I would like your confirmation. Thanks

4 Replies

AD Administrator Syncfusion Team February 2, 2004 02:39 PM UTC

I do not see this problem using with the attached sample. Do you? Instead of using a ADO.NET Relation to supply the binding between to master-detail, you have more flexibility if you just bind the two grids to the two tables, and then impose a DataTable.DefaultView.RowFilter on the child grid in the CurrentCellMoved event of the parent grid.

ST stefan_t February 2, 2004 04:54 PM UTC

You are right I can''t reproduce the problem even modifying the sample to work my way. I have three questions. 1. Is there any event to inform about ListChanges without to need subscription to DataView.ListChanged. 2. What is Binder.OptimizeListChanged? 3. When I edit a new grid Row I call immediately the Binder.AddNew through the RowEditing event. The first time only after grid creation I got a delay of 2-3 seconds to create the new row ( after calling the AddNew) In subsequent changes it works normally Do you have any idea ? Thanks in advance

AD Administrator Syncfusion Team February 2, 2004 10:39 PM UTC

1) There are no grid events that are fired when the underlying data source object changes its values. The grid does listen to events to catch these changes, but does not fire any since you could subscribe to the data source events. 2) /// /// Lets you specify to use a more optimized way to handle ListChanged event. This is /// experimental for the 2.0 beta. If this setting breaks your existing code then /// you should set it false. If you need faster handling of adding and removing /// records, you should set it true. /// 3) Is there are exception being thrown? Try setting the debugger to break on exception to see if that points to some problem.

ST Stefan T February 3, 2004 05:09 PM UTC

Thanks >3) Is there are exception being > thrown? Now it works fine . An exception being thrown at OnQueryCellInfo line 0. I handle the QueryCellInfo event In case of empty row I was setting the e.handled=true. I delete the statement for new empty row and now it is ok.

Live Chat Icon For mobile
Up arrow icon