|
//Resize behavior
gridGroupingControl1.TableModel.Options.ResizeColsBehavior = GridResizeCellsBehavior.ResizeAll;
gridGroupingControl1.TableControl.AllowColumnResizeUsingCellBoundaries = true;
//Event triggering
this.gridGroupingControl1.TableControlResizingColumns += GridGroupingControl1_TableControlResizingColumns;
//Event customization
private void GridGroupingControl1_TableControlResizingColumns(object sender, GridTableControlResizingColumnsEventArgs e)
{
if(e.Inner.Reason == GridResizeCellsReason.MouseUp && e.TableControl.Model.Options.ResizeColsBehavior == GridResizeCellsBehavior.ResizeAll)
{
e.Inner.Cancel = true;
int index = this.gridGroupingControl1.TableDescriptor.ColIndexToField(e.Inner.Columns.Right);
GridColumnDescriptor column = this.gridGroupingControl1.TableDescriptor.Columns[index];
int frozencount = e.TableControl.InternalGetFrozenCols();
int frozen = e.TableControl.Model.ColWidths.GetTotal(0, frozencount);
//To claculate the extended width of column
int extendedPoints = (e.Inner.Point.X - frozen) % column.Width;
//To get the resized column width
int width = column.Width + extendedPoints;
foreach (GridColumnDescriptor col in this.gridGroupingControl1.TableDescriptor.Columns)
{
//To set the column width for each cells
this.gridGroupingControl1.TableDescriptor.Columns[col.Name].Width = width;
}
}
} |
|
//Resize behavior for single column
gridGroupingControl1.TableModel.Options.ResizeColsBehavior = GridResizeCellsBehavior.ResizeSingle;
//enable resize on cell boundaries
gridGroupingControl1.TableControl.AllowColumnResizeUsingCellBoundaries = true; |
|
Query |
Response |
|
I find the solution.
The problem comes when I fixe the following parameters before populate the gridGroupingControl1:
// Initialize the Zooming to GridGroupingControl
ZoomGroupingGrid zoom = new ZoomGroupingGrid(this.gridGroupingControl1);
ZoomGroupingGrid.zoomCell = false;
zoom.ZoomSize = new Size(100, 100);
zoom.ZoomBorderSize = 5;
zoom.ZoomFactor = 1.5f;
Thank you very much for your support. |
We are glad to hear that the workaround was find by yourself. Before populating the grid, the ColumnWidth will be set to its default width and when the columns are resized with Zooming, the width will be calculated based on the current percentage of the columns. Since, the default width set to the columns before, the issue might be occurred at your end. So, we would suggest you to enable the zoom for the grid after all the customization for the grid is done. |
|
Can you guide me for customize the textual menu of the dynamic filter. I want translate it to others languages? |
The GridGroupingControl, have the direct support to localize the strings of DynamicFilter and already we provided a sample to localize the strings. Please make use of the sample in the below location in your local machine,
Dashboard sample location: <Install_Location>\Syncfusion\EssentialStudio\<Prduct_Version>\Windows\Grid.Grouping.Windows\Samples\Localization Samples\Localization Demo\CS |