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.

Stretch all Grid Columns to Client Width

Thread ID:

Created:

Updated:

Platform:

Replies:

48376 Aug 25,2006 08:07 AM Aug 25,2006 09:50 AM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 25, 2006 08:07 AM

Hello. I am trying to determine the best method for sizing columns in a GridGroupingControl so that the columns stretch to fill the entire grid client area. I have found similar posts which stretch the final column in the collection only, but rather than expand/reduce the size of the final column only, I want each column (except for row headers, if they are visible) to expand and shrink as the grid is resized.

What is the best approach for accomplishing this?

Administrator [Syncfusion]
Replied On August 25, 2006 08:24 AM

I wanted to clarify this previous post.

I would like the column widths to resize proportionally (e.g. increase the size by 100 on a four-column grid, and each column expands its initial size by 25), as opposed to simply dividing the cilent size evenly among all grid columns.

Thanks for any help you can provide.

>Hello. I am trying to determine the best method for sizing columns in a GridGroupingControl so that the columns stretch to fill the entire grid client area. I have found similar posts which stretch the final column in the collection only, but rather than expand/reduce the size of the final column only, I want each column (except for row headers, if they are visible) to expand and shrink as the grid is resized.

What is the best approach for accomplishing this?

Administrator [Syncfusion]
Replied On August 25, 2006 09:02 AM

Hi John,

If you want all columns in the grid to grow and contract as you size the grid, you can do this in QueryColWidth event handler. Refer to the GridDataBoundImageCell sample in the browser samples that has some code that does this.

\Syncfusion\Essential Studio\4.1\Windows\Grid\Samples\DataBound\GridDataBoundImageCell

Regards,
Rajagopal

Administrator [Syncfusion]
Replied On August 25, 2006 09:20 AM

Hi Rajagopal,

Thanks for your response. I have one additional question regarding this issue.

When the QueryColWidth handler is invoked, what is the best way to determine if the row is a Plus/Minus expansion button? When I have hierarchical data defined, the Plus/Minus column is being resized as well, which I would prefer to avoid.

Is there a property that I can query, using the {e.Index} of the QueryColWidth argument that will tell me whether I am on a row which contains the Plus/Minus button versus a row which contains data?

Thanks for your help with this.

>Hi John,

If you want all columns in the grid to grow and contract as you size the grid, you can do this in QueryColWidth event handler. Refer to the GridDataBoundImageCell sample in the browser samples that has some code that does this.

\Syncfusion\Essential Studio\4.1\Windows\Grid\Samples\DataBound\GridDataBoundImageCell

Regards,
Rajagopal

Administrator [Syncfusion]
Replied On August 25, 2006 09:50 AM

Sorry. Read the last paragraph as:

Is there a property that I can query, using the {e.Index} of the QueryColWidth argument that will tell me whether I am on a column which contains the Plus/Minus button versus a column which contains data?


>Hi Rajagopal,

Thanks for your response. I have one additional question regarding this issue.

When the QueryColWidth handler is invoked, what is the best way to determine if the row is a Plus/Minus expansion button? When I have hierarchical data defined, the Plus/Minus column is being resized as well, which I would prefer to avoid.

Is there a property that I can query, using the {e.Index} of the QueryColWidth argument that will tell me whether I am on a row which contains the Plus/Minus button versus a row which contains data?

Thanks for your help with this.

>Hi John,

If you want all columns in the grid to grow and contract as you size the grid, you can do this in QueryColWidth event handler. Refer to the GridDataBoundImageCell sample in the browser samples that has some code that does this.

\Syncfusion\Essential Studio\4.1\Windows\Grid\Samples\DataBound\GridDataBoundImageCell

Regards,
Rajagopal

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.

;