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.
Unfortunately, activation email could not send to your email. Please try again.

When does ClearCells fail

Thread ID:

Created:

Updated:

Platform:

Replies:

12219 Mar 24,2004 04:18 AM Mar 24,2004 07:34 AM Windows Forms 3
loading
Tags: GridControl
Samuel Jack
Asked On March 24, 2004 04:18 AM

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 05:14 AM

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\2.0.3.0\Grid\Src\Base\Model\GridModel.cs(5998). ForumClearCells_9258.zip

Samuel Jack
Replied On March 24, 2004 06:27 AM

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 07:34 AM

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.

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.

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.

;