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.

Manually setting width on columns produces inconsistent results

Thread ID:

Created:

Updated:

Platform:

Replies:

49830 Sep 28,2006 01:12 AM Sep 29,2006 01:12 AM Windows Forms 3
loading
Tags: Grouping
jamesb
Asked On September 28, 2006 01:12 AM

I am trying to set specific column width when the ggc load (using the code snippet below) and make specific column non-resizable. However, the ggc produces unexpected result. The column width are no where near what are set and are even out of proportion. Am i using the wrong calls?
this.gridGroupingControl.TableModel.ColWidths["Rate"] = 70; this.gridGroupingControl.TableModel.ColWidths["Total"] = 100;

Administrator [Syncfusion]
Replied On September 28, 2006 04:59 AM

Hi James,

For Resizable columns :

To change the individual column width manually,You could try this code snippet:

this.gridGroupingControl1.TableDescriptor.Columns["parentID"].Width = 175;

//For paticular table.
this.gridGroupingControl1.GetTableDescriptor("Deals").Columns["PaymentAmount"].Width=50;

For Non Resizable columns :

You can handle the QueryColWidth event and set the width of the fixed column. Below is a code snippet.

private void TableModel_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
GridTableModel model = sender as GridTableModel;
GridTableDescriptor td = model.Table.TableDescriptor;
int index = model.ColIndexToField(e.Index);

if( index != -1 && td.VisibleColumns.Count > index )
{
string ColName = td.VisibleColumns[index].Name;

if( ColName == "ParentName")
{
e.Size = 20;
e.Handled = true;
}
}
}

Thanks,
Haneef

jamesb
Replied On September 28, 2006 01:14 PM

Neither of the code below is working. When the grid load, the columns are all squished up!

this.gridGroupingControl.TableModel.ColWidths["col"] = 70;

this.gridGroupingControl.TableDescriptor.Columns["col"].Width = 175;

Administrator [Syncfusion]
Replied On September 29, 2006 01:12 AM

Hi James,

Sorry for the inconvenience caused.

If you can upload a sample showing the problem or tell us how to see the problem in one of the browser samples we ship, we can try to resolve the problem.

Thanks for your patience.

Best Regards,
Haneef

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.

;