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.

Bug: RectangleRightOfCol is off by 1

Thread ID:

Created:

Updated:

Platform:

Replies:

46650 Jul 18,2006 05:49 AM Jul 26,2006 05:39 AM Windows Forms 9
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 18, 2006 05:49 AM

The rectangle returned by RectangleRightOfCol *includes* the width of the specified column. So either the name is wrong and should be RectangleLeftOfCol or there''s an off by 1 bug in the code. library version is 4.2.0.37

Administrator [Syncfusion]
Replied On July 18, 2006 06:37 AM

Hi Palmer, GridViewLayout.RectangleRightOfCol method is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default. It returns the control region right (RTL: left) of an absolute column index. Thanks Haneef

Administrator [Syncfusion]
Replied On July 18, 2006 07:10 AM

Hi Haneef, I understand, but by that definition the method still returns incorrect information. It doesn''t return the control region right of an absolute column index, the returned rectangle INCLUDES the width of the specified column. in ASCII art (with A,B,C columns and . empty control area) RectangleRightOfCol(C) AAAA|BBBBB|CCCCC|............ should return ------------ actual return ------------------ >Hi Palmer, > >GridViewLayout.RectangleRightOfCol method is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default. It returns the control region right (RTL: left) of an absolute column index. > >Thanks >Haneef

Administrator [Syncfusion]
Replied On July 18, 2006 08:06 AM

Hi Palmer, We tried to reproduce this issue in 4.2 with .Net 2003 + Windows XP sp2, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample working fine here. Can you post a small sample showing this problem or tell us how to see it in the Attached sample?. Please let me know the version number of Studio you are testing this with and the .Net version. Sample: http://www.syncfusion.com/Support/user/uploads/GridControlResize_edcaba52.zip If you can send us some relevant screen shots, we will try debugging here. Best Regards, Haneef

Administrator [Syncfusion]
Replied On July 18, 2006 09:05 AM

Hi Haneef, I''ve attached a modified sample illustrating the problem. The code behind the button calls these 2 functions: gridControl1.ViewLayout.RectangleBottomOfRow (gridControl1.RowCount, GridCellSizeKind.VisibleSize); gridControl1.ViewLayout.RectangleRightOfCol (gridControl1.ColCount, GridCellSizeKind.VisibleSize); The red bars are the actual height/width of the returned rectangle, the green bars are what they should be according to the doc.

ViewlayoutRectangles.zip

Administrator [Syncfusion]
Replied On July 19, 2006 07:15 AM

Hi Palmer,

We are currently looking into this issue and will update you the details.

Thanks for your patience.
Best Regards,
Haneef

Administrator [Syncfusion]
Replied On July 19, 2006 07:48 AM

Hi Palmer,

Sorry for the inconvenience caused.

RectangleRightOfCol method returns the control region right (RTL: left) of an absolute column index of the grid. It receives two argument. First argument is an integer which always starts from one (it is not zero-based index). Second argument is GridCellSizeKind enumeration. GridCellSizeKind.ActualSize is specified as default.

Try this code.

// gridControl1.RowCount/ColCount returns the zero based index of the grid ros/column.
//gridControl1.ViewLayout.VisibleRows retruns the number of rows in theViewLayout. (1- based Index)
gridControl1.ViewLayout.RectangleBottomOfRow (gridControl1.ViewLayout.VisibleRows, GridCellSizeKind.VisibleSize);
gridControl1.ViewLayout.RectangleRightOfCol (gridControl1.ViewLayout.VisibleCols , GridCellSizeKind.VisibleSize);

Thanks
Haneef

Administrator [Syncfusion]
Replied On July 19, 2006 09:40 AM

Hi Haneef,

I guess we''re going to have to agree to disagree on this one.
If all the indexes in the grid are 0-based, why is this one 1-based?

All of the following affect column A in a default grid, which one looks wrong?
grid.Cols.Hidden[1]
grid.ColWidths[1]grid.ViewLayout.RectangleRightOfCol(2)
grid.ColStyles(1)
grid [-1,1]


Administrator [Syncfusion]
Replied On July 20, 2006 12:02 AM

Hi Palmer,

I have contacted the development team regarding this and will let you the details, when I hear back from them.

Thanks for your interest in Syncfusion Products.
Regards,
Haneef

Administrator [Syncfusion]
Replied On July 26, 2006 05:39 AM

Hi Palmer,

The method RectangleRightOfCol is a helper method used to compute the rectangle that needs to be refreshed when you remove or insert a column in the grid in the source. So, if you think about inserting a column at 5, you need to repaint starting at the left edge of column 5 all the way to the right edge of the grid. This is the rectangle that this method returns when you pass in 5.

It just that the docs do not properly reflect the intended functionality by not mentioning that the passed-in column is included in the rectangle.

Here is the link to the defect.
http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=2441

It has been fixed internally and will be available in the next release.

Best Regards,
Leo.

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.

;