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
close icon

Grid resizing issue

Hi,

PFA FFGrid derived from GridControl. I have two issues in the implementation of FFGrid:

1. I have an option of proportionate reisze of columns based on grid contents or custom resize where in user resizes the columns using mouse.

Steps to repro:
- Start the application.
- Right click on the header. Choose Resize Options -> Custom form the context menu.
- Now try to resize the columns using mouse, it is not possible. Columns should be resized by the user when Custom option is choosen.

2. TableStyle.Trimming is set to StringTrimming.EllipsisCharacter. But this setting has no effect on the grid. If I set this in QueryCellInfo then this is working fine. Why the TableStyle setting didn't have any effect?

Kindly let me how to resolve the issue. Thanks.

Regards
Kiran


POC2.zip

2 Replies

HA haneefm Syncfusion Team May 9, 2007 05:54 PM UTC

Hi Kiran,

Issue 1: Resizing the columns in a grid.

You need to set the width of the columns in the OnResizeColumns override method. Below is a code snippet.

protected override void OnResizingColumns(GridResizingColumnsEventArgs e)
{
//Double Click actually shows the hidden cloumns. So cancel it.
if (e.Reason == GridResizeCellsReason.DoubleClick && !this.UseProportionateColResizing)
{
if (this.ViewLayout.VisibleCellsRange.IsEmpty)
this.ColWidths.ResizeToFit(GridRangeInfo.Cols(1, this.ColCount), GridResizeToFitOptions.IncludeHeaders);
else
this.ColWidths.ResizeToFit(this.ViewLayout.VisibleCellsRange, GridResizeToFitOptions.IncludeHeaders);
e.Cancel = true;
}
else if (this.UseProportionateColResizing && e.Reason == GridResizeCellsReason.HitTest)
e.Cancel = true;
else if (!this.UseProportionateColResizing && e.Reason == GridResizeCellsReason.MouseUp)
{
this.ColWidths[e.Columns.Left] = e.Width;
}
else
base.OnResizingColumns(e);
}

Issue 1: Setting the Trimming property.

You can try setting this property in a OnQueryCellInfo method and let me know if this helps.

Please refer to the attached sample for implementation.
ModifiedPOC2.zip

Best regards,
Haneef


KR Kiran Reddy May 10, 2007 08:02 AM UTC

1. Grid resize worked.
2. I already specified it worked if I set Trimming in QueryCellInfo. I want to know why it didn't when I set it in TableStyle.

Thanks.

Regards
Kiran

Loader.
Live Chat Icon For mobile
Up arrow icon