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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

After Deleting Record from grid scroll is not working

Thread ID:

Created:

Updated:

Platform:

Replies:

44766 Jun 2,2006 10:29 AM UTC Dec 6,2006 10:10 AM UTC WinForms 3
loading
Tags: GridControl
Shashi
Asked On June 2, 2006 10:29 AM UTC

Scrolling option is not working after deleting record from a grid. Out of Range Exception Coming..any idea. I am sending code here protected override void OnMouseWheel(MouseEventArgs e) { if ((e.Delta > 0 ) && (this.Binder.CurrentPosition >0) ) { this.Binder.CurrentPosition = this.Binder.CurrentPosition - 1; this.ScrollCellInView(this.Binder.CurrentPosition, 0); } if ((e.Delta < 0 ) && (this.Binder.CurrentPosition < this.Binder.RecordCount-1) ) { this.Binder.CurrentPosition = this.Binder.CurrentPosition + 1; this.ScrollCellInView(this.Binder.CurrentPosition+1, 0); } } Regards shashi

Administrator [Syncfusion]
Replied On June 2, 2006 11:00 AM UTC

Hi Shashi, You need to change the currentcell position and binder.currentPosition before delete the record from the grid. Here is a code snippet this.gridDataBoundGrid1.Binder.EndEdit(); this.gridDataBoundGrid1.Binder.SuspendBinding() ; int RowIndex = this.gridDataBoundGrid1.CurrentCell.RowIndex; int ColIndex = this.gridDataBoundGrid1.CurrentCell.ColIndex; int Position = this.gridDataBoundGrid1.Binder.CurrentPosition; ArrayList list = this.gridDataBoundGrid1.DataSource as ArrayList; if(list != null ) { this.gridDataBoundGrid1.CurrentCell.MoveTo(0,0); this.gridDataBoundGrid1.Binder.CurrentPosition = 0; list.RemoveAt(list.Count -1 ); } this.gridDataBoundGrid1.Binder.ResumeBinding(); this.gridDataBoundGrid1.Binder.EndEdit(); this.gridDataBoundGrid1.Refresh(); this.gridDataBoundGrid1.Focus(); this.gridDataBoundGrid1.CurrentCell.MoveTo(RowIndex , ColIndex); this.gridDataBoundGrid1.Binder.CurrentPosition = Position; Here is a sample. http://www.syncfusion.com/Support/user/uploads/arraylistsource_3f0b7e16.zip Could you please run this at your end and let me know how it goes? Thanks for choosing Syncfusion Products. Regards, Haneef

Leema
Replied On December 1, 2006 05:53 AM UTC

if ((e.Delta > 0 ) && (this.Binder.CurrentPosition >0) )
{
this.Binder.CurrentPosition = this.Binder.CurrentPosition - 1;
this.ScrollCellInView(this.Binder.CurrentPosition, 0);
}
if ((e.Delta < 0 ) && (this.Binder.CurrentPosition < this.Binder.RecordCount-1) )


{
this.Binder.CurrentPosition = this.Binder.CurrentPosition + 1;
this.ScrollCellInView(this.Binder.CurrentPosition+1, 0);
}


/////////////

this.Binder.RecordCount returns only root tables recordcount so scroll comes upto that row count but there are around 150 rows.

Is there any solution...

Thanks in Advance...

Administrator [Syncfusion]
Replied On December 6, 2006 10:10 AM UTC

Hi Leema,

Please refer to the below forum thread for more details.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=52923

Best Regards,
Haneef

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.

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

;