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.

How to set the width of a column

Thread ID:

Created:

Updated:

Platform:

Replies:

83537 Jun 25,2009 02:32 PM Nov 2,2010 01:09 AM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Manuel De Leon
Asked On June 25, 2009 02:32 PM

This should have been really easy to do, or at least easy to find in your examples/demos/forums, but here I am asking it.

How can I set the width of a column?

I went to the GridColumnDescriptor Collection Editor, changed the widths of my columns, but they keep resizing based on the contents of the fields.

I also tried a whole bunch of other stuff in the design and via code to no avail.

Rekha P [Syncfusion]
Replied On June 26, 2009 09:03 AM

Hi Manuel,

Thank you for your interest in Syncfusion Products.

The column with can be set using the Width property referred from the GridColumnDescriptor collections. Refer any one of the way to set the Width for the Grid columns.

[ASPX]








[C#]
//To set the width uniformly for all the columns.
foreach (GridColumnDescriptor gcd in this.GridGroupingControl1.TableDescriptor.Columns)
{
gcd.Width = 90;
}

//To set it for individual columns.
this.GridGroupingControl1.TableDescriptor.Columns[0].Width = 50;
this.GridGroupingControl1.TableDescriptor.Columns[1].Width = 50;


Please let me know if these snippets helps you out.

Thanks,
Rekha

Peter Fithian
Replied On October 27, 2010 01:56 PM

In case anyone, like me, reads this and thinks it will work - it doesn't.


Bharath M [Syncfusion]
Replied On November 2, 2010 01:09 AM

Hi Peter,

We regret for the inconvenience caused.

We have tested the solution provided and it is working fine. Could you please update us a simple sample to reproduce this issue, so that we could sort out the cause of the issue and provide you a solution.

Let me know if you have any concerns.

Regards,
Bharath


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.

;