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

image outside bordermargins

Thread ID:





10607 Feb 6,2004 04:38 PM UTC Feb 7,2004 08:55 AM UTC WinForms 3
Tags: GridControl
Andy Barnhart
Asked On February 6, 2004 04:38 PM UTC

I am using the 2.0 beta and in a GridControl I am attempting to indent text and an image in one column. I do it like this: gridCtl[nxt,1].BorderMargins.Left = 20 * iLevel; This does exactly what I want when the cell has the focus, but when I click on another row, the text stays indented but the image moves to the left edge of the cell area, ignoring the margin.

Andy Barnhart
Replied On February 6, 2004 10:39 PM UTC

I uploaded a small picture to help explain this. You can see a collapse button (an image in the cell) on the left next to "Industry Segments". That one is right where it should be. The one inside the focus rectangle is right where it should be also, but it wasn''t until I selected the cell. It was off to the left like the one below it ("Obtain and review...") which should be at the same indentation as the one in the focus rectangle. There is another more subtle bug. The image is the same for all 3 rows. But the one inside the focus rectangle isn''t clear. It appears to have been rendered at a slightly different size. sfprob_1818.zip

Administrator [Syncfusion]
Replied On February 7, 2004 07:43 AM UTC

The problem is that the static drawing draws to the cellbounds and the active drawing draws to the clientRectangle (which takes into account the margins). You can work around this problem until there is a release available that changes this behavior. You can handle the CellDrawn event, and just draw the bitmap there. This gives you complete control over where you put the bitmap. Here is a little sample showing how you might to it. Another option is to derive your own cell control that handles indents. There is a sample of this type of control in Syncfusion\Essential Suite\Grid\Samples\In Depth\VirtTreeGrid.

Andy Barnhart
Replied On February 7, 2004 08:55 AM UTC

Thanks. The little sample you uploaded solves both problems in an acceptably small amount of code. I looked at the big sample earlier; there is a lot more code than I want to introduce and maintain to solve a simple issue. Other grids I have looked at have indent levels and do expand/collapse just by setting a couple of column properties and a cell level.


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