7

Oout of the box the Infragistics UltraGrid control allows you to make the last column in a grid spring to fill the remaining unused portion of the grids bounding rectangle.

____________________________
| Col1 | Col 2 | Col 3---->|
|                          |

I have searched but cannot find a method of making a column that is not the end column spring to fill the width.

For example, a row that has a text description followed by a column that contains a button to perform some action. You want the text description to take most of the width, and have the column with the button butt up to the end of the grid's bounding rectangle.

__________________________________
| Text Col ------------>| Button |
|                                |

Has anyone got any experience of attempting to get the UltraGrid control to do this out of the box, or some hack to make it work?

4

1 に答える 1

13

これは、組み込みの Infragistics グリッドを使用してきれいに行うことができます。

  1. Grid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns を設定します。
  2. 固定境界内に維持する列の Width、MinWidth、および MaxWidth プロパティを設定します (私の場合、ボタンのある列は幅 150 に設定されています)。

最小幅と最大幅が固定されているすべての列は、指定した最小幅と最大幅の間で幅が変動し、最大値に達すると成長が止まり、その時点で最大値が適用されていない他のすべての列は成長し続けます。残りの水平スペースを埋めます。

于 2009-09-09T17:11:51.900 に答える