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

When does ClearCells fail

Thread ID:





12219 Mar 24,2004 09:18 AM UTC Mar 24,2004 12:34 PM UTC WinForms 3
Tags: GridControl
Samuel Jack
Asked On March 24, 2004 09:18 AM UTC

I have a situation in which the ClearCells method does not clear the cells I have asked it to, and it returns false. What causes ClearCells to return false? An additional question about ClearCells: when I have a grid with only two columns and about three rows, if I pass ClearCells the GridRangeInfo obtained from GridRanageInfo.Rows(1,3) say, it takes a noticable amount of time to clear the cells. Surely you''re not ignoring the ColCount of the Grid and actually clearing all the millions of cells in the row?

Administrator [Syncfusion]
Replied On March 24, 2004 10:14 AM UTC

If you are clearing styles, then ClearCells will fail when this call returns false: ChangeCells(expandedRange, GridStyleInfo.Empty, StyleModifyType.Remove); It tries to empty the styles in the cells in the expanded range. If you are not clearing styles, then ClearCells will fail when this call return false: style.ApplyFormattedText("", GridCellBaseTextInfo.ClearCells); So, exactly what kind of cells is the clearing failing on? Are they ReadOnly or are the cells something that a empty text or empty style would not be a proper value for? The code does call ExpandRange to convert any row range to a cell range before it does any looping. In the sample below, I don''t really see any significant difference in using cell ranges or row ranges. The one that is done first takes a little more time because of the JITing. Do you see a difference in the sample? If you own the source, the operable code is in Essential Suite\\Grid\Src\Base\Model\GridModel.cs(5998). ForumClearCells_9258.zip

Samuel Jack
Replied On March 24, 2004 11:27 AM UTC

In the one case the cells I was clearing had a CellValueType of DateTime. In the other, they were set to the type of one of my objects. They weren''t readonly. No, I don''t see a difference in the sample

Administrator [Syncfusion]
Replied On March 24, 2004 12:34 PM UTC

Is this a GridDataBoundGrid with the values coming from some DataTable? If so, do these DataColumns have AllowDBNull = true so they can be set empty? Check the output window to see if there are any exceptions being thrown. That might shed some light on why things are not being cleared. Seeing exceptions might also explain why some clearing is taking longer than other clearings.


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