BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Matthias,
Thank you for your interest in Syncfusion products.
If you want to set all column as same width in a grid, you can use “QueryColWidth” event. Using this event and set the size by Size property. Please refer the below code,
Code:
this.gridGroupingControl1.TableModel.QueryColWidth += new GridRowColSizeEventHandler(TableModel_QueryColWidth);
void TableModel_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
e.Size = 20;
e.Handled = true;
}
Please let us know if you have any concern.
Regards,
Muthukumar K
Hi Muthukumar,
thanks for your reply. This would set all columns to a fixed width of 20px. Not quite what I want to achive. I want the width of all columns to fill the space of the grid control. Width of each column should be subject to the columns content. In other words, I dont want empty space inside the grid.
Best Regards,
Matthais
Hi Matthias,
Thank you for your interest in Syncfusion products.
We have implemented generic classes(helper classes) named as GridColSizingHelper. The GridColSizingHelper class includes the customization for column width resizing according to client size. Please refer the below code to wire the Grid to the helper classes,
Code Snippet:
private GridColSizingHelper Helper1;
private void Form1_Load(object sender, EventArgs e)
{
Helper1 = new GridColSizingHelper();
Helper1.WireGrid(this.gridControl1);
}
Please let us know if you have any concern.
Regards,
Muthukumar K