The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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).
ADAdministrator 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.
ADAdministrator 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?
ADAdministrator 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.
ADAdministrator 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.