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

Bug: RectangleRightOfCol is off by 1

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

9 Replies

AD Administrator Syncfusion Team July 18, 2006 10:37 AM UTC

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


AD Administrator Syncfusion Team July 18, 2006 11:10 AM UTC

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


AD Administrator Syncfusion Team July 18, 2006 12:06 PM UTC

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


AD Administrator Syncfusion Team July 18, 2006 01:05 PM UTC

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


AD Administrator Syncfusion Team July 19, 2006 11:15 AM UTC

Hi Palmer,

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

Thanks for your patience.
Best Regards,
Haneef


AD Administrator Syncfusion Team July 19, 2006 11:48 AM UTC

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


AD Administrator Syncfusion Team July 19, 2006 01:40 PM UTC

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]



AD Administrator Syncfusion Team July 20, 2006 04:02 AM UTC

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


AD Administrator Syncfusion Team July 26, 2006 09:39 AM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon