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
close icon

Grouping grid and CurrencyManager

I am trying to make the grid scroll a row with an error into view. To do this, I set currencyManager.Position = rowIndex; However, I get inconsistent behaviour from the grid. Sometimes the row is scrolled into view and somethimes not. If the cursor is already positioned on that row, but scrolled out of view, the grid scrolls the row back into view. However, if the cursor has been placed on another row, the row with the error is not scrolled into view. I have checked that the gridGroupingControl1.CurrencyManager.CurrentChanged event is fired and that the Position property of the currency manager is correct. Do you have any idea what can be the problem here? I would like a solution that always scrolls the row into view (and expands any collapsed groups as necessary).

4 Replies

AD Administrator Syncfusion Team June 16, 2005 01:42 PM UTC

Try code like: GridRecord rec = this.gridGroupingControl1.Table.Records[rowIndex] as GridRecord; rec.SetCurrent(); to see if it does what you want.


AD Administrator Syncfusion Team June 16, 2005 03:56 PM UTC

I would prefer not to deal directly with the grid, since I may have more than one grid bound to the same source. I believe the idea of data binding is that all the bound controls should update their positions when the position of the underlying currency manager changes. Isn''t this the case for the grouping grid?


AD Administrator Syncfusion Team June 16, 2005 07:57 PM UTC

Only if all controls are using the same bindingcontext. But setting GridRecord rec = this.gridGroupingControl1.Table.Records[rowIndex] as GridRecord; rec.SetCurrent(); should properly position the currencymanager that the grid is using. So, it would not make any difierence whether the grid moved first and teh currencymanager responded, or that the currencymanager moved first and the grid responded. If you can upload a sample project showing the problem, we can try to see why setting the currencymanager is not working in this case.


AD Administrator Syncfusion Team June 17, 2005 03:14 PM UTC

Hi Clay. I did some more testing, and it turned out that the grid does not react to the PositionChanged event of the currency manager if it is grouped and there is no selected record. This happens if you click one of the grouping headers for example. To solve the problem I subscribed to the PositionChanged event of the currency manager and there I used the code you suggested above. (Had to replace Records by UnsortedRecords). Now it seems to work fine.

Loader.
Live Chat Icon For mobile
Up arrow icon