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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resizing covered columns

Thread ID:





30101 Jun 10,2005 03:48 PM UTC Jun 11,2005 07:46 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On June 10, 2005 03:48 PM UTC

We have a bunch of changes to the behavior of column resizing in our grid and to that end, I''ve created a resizing controller based off the default one. Where I''m having a problem is with resizing covered cells, in particular, resizing them smaller. In our grid, we might have mutliple rows of column headers. They''re hierarchical in their design. For example, in the first row, I may have a column header that spans (is covered) across 5 columns. In the second row, I might have 5 column headers that are all "children" of that parent. When the cursor is on the first row, I only allow resizing from the right hand side of that covered cell. When I resize, the parent column header (and release the mouse), the 5 child columns are resized proportionally. The problem I have is in resizing smaller. When I try to resize the covered cell to the left, it stops at the left hand side of the 5th child column. I understand why it behaves this way by default, but that''s not the behavior we''re looking for and I''m trying to fix it, but I can''t seem to find out where this is happening. I thought it was these two lines from MoveMarker: if (size.Width < (int) grid.Model.Options.MinResizeColSize) size.Width = (int) grid.Model.Options.MinResizeColSize; But I commented them out and it''s still stopping at the left hand side of the 5th column. I''ve attached a bitmap of the grid to give an idea of what it looks like. (BTW, where it says "Sample Text", that''s not really part of the grid). What I''m talking about is the part that says "Review Status" and then the 5 column headers underneath that. So basically, when I try to drag the right hand side of "Review" status to the left, it''s stopping at the left hand side of the "Pattern" column. On a somewhat related issue, we''re doing the covered ranges by handling the QueryCoveredRanges event. But from the controller if I look at grid.Model.CoveredRanges, it''s always empty. Why is this? Pete Davis mygrid_5785.zip

Administrator [Syncfusion]
Replied On June 11, 2005 07:46 AM UTC

Here is something to try. In your controller''s HitTest method, call the base class. If the baseclass call comes back true, and if hitTestInfo.colIndex points to the right edge of one of your covered ranges (see below), try setting hitTestInfo.colIndex equal to the left column of your covered range. I did not try this, but the idea is to fool the controller into thinking it is resizing the left-most column(and the mouse is already been moved to the rightmost column) of the covered range. Maybe this will allow the dragline to move anywhere in the covered range. The reason this.gridControl1.CoveredRanges is empty when you use QueryCoveredRanges is that the event makes everythiing dynamic. No ranges are stored, and all are provided on demand in QueryCoveredRange. The only ranges that show up in this.gridControl1.CoveredRanges are the ones that are explicitly added. Normally to decide where the hitTestInfo.colIndex point to a covered range, you can use GridRangeInfo range = this.gridControl1.CoveredRanges.FindRange(0, hitTestInfo.colIndex); But if you are using QueryCoveredranges to provide these ranges, then this will not work. You will have to decide this question from your specific knowledge of how covered ranges are determined (as in QueryCoveredRanges).


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