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

Auto Resizing Problem

When I auto resize a column , I am getting extra space after the last column which is shown by a Cross and I do not want it. What can I do? SizetoFit method does not work in GridControl Class. Thank you.



examplegridresizingproblem_3b9de34.zip

2 Replies

AD Administrator Syncfusion Team November 21, 2008 01:00 PM UTC

The Problem can be easily seen in the file attached in the above post Thank you.



NA Nisha Arockiya A Syncfusion Team November 24, 2008 11:34 AM UTC

Hi Vighnesh,

Thanks for your interest in Syncfusion Products.

Yan can resize grid columns inorder to fill the entire Grid using the following code snippet.Please refer to it.


this.gridControl1.QueryColWidth += new Syncfusion.Windows.Forms.Grid.GridRowColSizeEventHandler(this.gridControl1_QueryColWidth);

private void gridControl1_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (e.Index == this.gridControl1.Model.ColCount)
{
e.Size = this.gridControl1.ClientSize.Width - this.gridControl1.Model.ColWidths.GetTotal(0, this.gridControl1.Model.ColCount - 1);
e.Handled = true;
}
}

Please let me know if this helps.

Regards,
Nisha


Loader.
Live Chat Icon For mobile
Up arrow icon