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

Current Row not refreshing until deselected

Thread ID:

Created:

Updated:

Platform:

Replies:

15925 Jun 30,2004 10:26 AM Jul 2,2004 04:21 AM Windows Forms 5
loading
Tags: GridControl
Chris Dugdale
Asked On June 30, 2004 10:26 AM

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 11:08 AM

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 12:36 PM

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 01:40 PM

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 03:26 AM

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 04:21 AM

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.gridDataBoundGrid1.Refresh();
}

CONFIRMATION

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.

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.

;