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.

Cell Borders

Thread ID:

Created:

Updated:

Platform:

Replies:

10611 Feb 6,2004 01:29 PM Feb 12,2004 01:17 AM Windows Forms 8
loading
Tags: GridControl
Steve
Asked On February 6, 2004 01:29 PM

Is it possible to override the drawing of cell borders?

Administrator [Syncfusion]
Replied On February 6, 2004 04:54 PM

You can turn off the cell borders by setting: style.Borders.All = new GridBorder(GridBorderStyle.None); Then you can handle the CellDrawn event and draw the borders there.

Steve
Replied On February 7, 2004 06:11 AM

Can you also override the drawing of the cell borders that appear during drag-n-drop operations?

Steve
Replied On February 7, 2004 06:17 AM

Another instance of overriding the cell border that I''m interested in occurs when you focus leaves the grid and there is a "rubber-band" like outline on the cell.

Administrator [Syncfusion]
Replied On February 8, 2004 07:05 AM

Normally, visual ques for a drag & drop operations are done on top of the grid, and not really done ''to the grid''. That said, I think you can do it by handling all the D&D work yourself. If would take some effort. Here is minimal try (a very rough sample) at it that would have to be tested and special cases handled. It derives a gridcontrol and exposes 2 events that let you control where/when the d&d cursor appears, and allows you to draw the visual feedback for the drag. Both the default behavior and the sample event handlers draw on top of the grid. But instead of drawing on top of the grid, you might try setting style properties to the cells at this point (and then unsetting them when they are no longer needed). But usually drawing your own visual ques is what is done. simple_Drag_1_3814.zip

Steve
Replied On February 11, 2004 02:13 PM

Thanks Clay. Is there a method I can override or an event i can cach to draw the cell borders around the current cursor? Perhaps an override to some type of drawcursor method? Thanks.

Administrator [Syncfusion]
Replied On February 11, 2004 02:50 PM

There is a DrawCurrentCellBorder event you could try. Or, you can use the CellDrawn event, and if it is the currentcell, draw what you want over top of default drawing.

Steve
Replied On February 11, 2004 08:53 PM

OK, i''m catching the DrawCurrentCellBorder event and drawing and manually drawing a cursor that paints over two cells. It works well, if I tab to another application and then back, but just scrolling arounds is having some refresh issues on the extra cell that I''m drawing the cursor. I tried calling invalidate on the previous rectangle being drawn, but it creates an continous loop. Is this the best way to draw a cursor that actually covers too cells? If so, how would you suggest I handle the refresh issue. Thanks again! Steve

Administrator [Syncfusion]
Replied On February 12, 2004 01:17 AM

If you are not doing all your drawing in the same cell, then there will be a problem with scrolling because when the grid scrolls a line at the time, it only repaints the single newly exposed row, and uses WindowScroll to physically scroll the portion that remains visible. This windowscrolling has to occur at row boundaries and I expect that is causing this painting problem you are seeing. You can turn off this WindowScroll support, and force the grid to repaint the whole visible grid whenever you scroll a single row. The code is this.grid.DisableScrollWindow = true;, but this will adversely affect scrolling performance. But it will be easy to see if this is what is causing the problem. Some other options include deriving the grid, overriding OnPaint, call the base class, and then if the currentcell is visible do your painting at this point. Or, you could try handling the grid.WindowScrolled event and invalidate the area you need if it is visible.

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.

;