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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Current Row not refreshing until deselected

Thread ID:





15925 Jun 30,2004 02:26 PM UTC Jul 2,2004 08:21 AM UTC WinForms 5
Tags: GridControl
Chris Dugdale
Asked On June 30, 2004 02:26 PM UTC

Hi, I''ve got a GDBG hierarchical grid very similar to the Customers sample. (ie the grid is bound to a collection which implement IBindingList etc). However, when data is updated in the collection and a row is selected on the grid, the row does not update until another row becomes current and selected. How do I get round this? If I was writing a databinder, I''d force the update of the active row using :- _grid2.RefreshRange(GridRangeInfo, true); However this isn''t applicable in my scenario. Cheers Chris Dugdale

Administrator [Syncfusion]
Replied On June 30, 2004 03:08 PM UTC

In our 2.0 code, you might experiment setting grid.UseOptimizedListChanged true/false to see if either setting has an affect on this problem. If not, can you listen to the IBindingList.ListChanged event of the datasource, and if the position that changes is the current row, you can try calling the grid.RefreshRange code you mentioned.

Chris Dugdale
Replied On July 1, 2004 04:36 PM UTC

Hi, I''ve tried setting OptimzedListChangedEvent = true & false and this has no effect. I''ve also tried checking to see if the row being updated is the current selected row, and if it is I execute :- //Refresh the current selected row if(rowIndexToBeUpdated == _grid.Binder.CurrentPosition) { _grid.RefreshRange(GridRangeInfo.Row _grid.Binder.CurrentPosition),true); } However, this still does not update the selected row until it is deselected. Have you any other suggestions?

Administrator [Syncfusion]
Replied On July 1, 2004 05:40 PM UTC

Did you try listening to IBindingList.Changed event? //to hook teh event after you set the datasource CurrencyManager cm = (CurrencyManager)this.BindingContext[grid.DataSource, grid.DataMember]; IBindingList ibl = cm.List as IBindingList; if(ibl != null) ibl.ListChanged += new ListChangedEventHandler(ibl_ListChanged); //the handler private void ibl_ListChanged(object sender, ListChangedEventArgs e) { if(e.ListChangedType == ListChangedType.ItemChanged) { grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); } }

Chris Dugdale
Replied On July 2, 2004 07:26 AM UTC

Hi Clay, I tried the code you suggested and it had no effect. The row still doesnt update until it is de-selected. I''m stuck! Cheers Chris.

Administrator [Syncfusion]
Replied On July 2, 2004 08:21 AM UTC

Can you post a sample showing the problem. I tried to see it with this code in Grid\Samples\DataBound\Hierarchical\Customers and could not. I am using 2051, what are you using?
private void button1_Click(object sender, System.EventArgs e)
	CustomerCollection customers = (CustomerCollection)this.dataGrid1.DataSource;
	Customer cust = customers[0];
	cust.FirstName = "aaaaa";


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon