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.

Grid resizing issue

Thread ID:

Created:

Updated:

Platform:

Replies:

60588 May 8,2007 11:40 AM May 10,2007 04:02 AM Windows Forms 2
loading
Tags: GridControl
Kiran Reddy
Asked On May 8, 2007 11:40 AM

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

haneefm [Syncfusion]
Replied On May 9, 2007 01:54 PM

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

Kiran Reddy
Replied On May 10, 2007 04:02 AM

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

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.

;