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

SaveCellInfo causes an exception?

Thread ID:





16787 Jul 23,2004 01:20 PM UTC Jul 23,2004 08:36 PM UTC WinForms 3
Tags: GridControl
Justin Koh
Asked On July 23, 2004 01:20 PM UTC

I''m having an issue with a virtual grid. When I handle SaveCellInfo and set the e.handled to be false, sometimes syncfusion throws an ArgumentException in grid.dll saying that index was out of range: parameter row index. However, I can''t seem to trace which of my calls actually set this. Is this a known issue?

Administrator [Syncfusion]
Replied On July 23, 2004 01:55 PM UTC

If you are using a virtual grid, then you should more or less always set e.Handled = true in SaveCellInfo. If you do not, the grid will try to store the value in its GridData object. And, unless you have explicitly set grid.RowCount and grid.ColCOunt to be large enough to handle the values you are passing on by setting e.Handled = false, then you will get this error. So, by default, the grid is sized initially to 10x10 ''real'' rows and columns. So, as long as e.RowIndex and e.ColIndex is less than 10, then you can get away with setting e.Handled = false as the proper space has been allcoated by default. But once the row and col exceed 10x10, then there is a problem. Normally, you would not want to arbitrarily set RowCount and ColCount as one point of a virtual grid is to avoid the grid setting up its own data storage. This is the reason you normally set e.Handled = true in SaveCellInfo as you are normally responsible for saving anything that needs saving, and do not want the grid to save things itself. Now if you do want the grid to save some things, then you would set e.Handled = false, but you will be responsible to setting the RowCount and ColCount so the grid will have sufficient space allocated to hold what you want it to save.

Justin Koh
Replied On July 23, 2004 07:19 PM UTC

The reason I was using e.Handled = False was to deny the move and reset the value. What should I do if I want this functionality? Set the e.Style.Text property in SaveCellInfo back?

Administrator [Syncfusion]
Replied On July 23, 2004 08:36 PM UTC

Normally you would handle the grid.CurrentCellValidating event to validate a changed cell value as you leave the cell. You can getteh new value from grid.CurrentCell.Renderer.ControlText, and if it is not proper, then set e.Cancel = true.


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