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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridTreeControl: Column Width

Thread ID:

Created:

Updated:

Platform:

Replies:

102810 Mar 5,2012 12:40 PM UTC Mar 8,2012 12:24 PM UTC WPF 6
loading
Tags: GridControl
Sean Roddis
Asked On March 5, 2012 12:40 PM UTC

Hey,

I have a problem. I cant set the width of a column in a GridTreeControl. In c#.

I can set the columnwidth in the xaml, but only for the first time. If I reset the grid, and try to resize the columns nothing happens.
So i debugged the part of SourceCode. I can see, that the Values are parse right and the new width must be my set Value. But it isnt.

I turned off the behavouir as well... and tryed a few things. But after 5 h now, i dont know what i can try next.

Here is a code snipe:

LiquiditaetsAusgabe.Reset();

//liquiditätsplan.GetParentTable() Just gives a smal DataView //over some columns.
TreeGrid.ItemsSource =
liquiditätsplan.GetParentTable(HauptSet, "");

this.TreeGrid.DefaultColumnWidth = 150;
this.TreeGrid.EnableHotRowMarker = true;
this.TreeGrid.EnableNodeSelection = true;
this.TreeGrid.PercentSizingBehavior = GridPercentColumnSizingBehavior.None; this.LiquiditaetsAusgabe.AllowAutoSizingNodeColumn = false;

// this.TreeGrid.InternalGrid.Columns[0].Width = 300.0;
// this.TreeGrid.Model.ColumnWidth[0] = 300.0;
this.TreeGrid.Columns[0].Width = 300.0;

Even the DefaultColumnWidth dosnt work.




Rajasekar G [Syncfusion]
Replied On March 7, 2012 10:54 AM UTC

Hi Roddis,

Width and ColumnWidth properties are working fine when we set in Code behind[C#] also. We have prepared the sample and code snippet for this. Please revert us with the modified sample if you are still facing the issue. Please refer attached image and sample program.

Code snippet:
//Setting default Width to column
this.treeGrid.DefaultColumnWidth = 50;

treeGrid.ModelLoaded += (s, e) =>
{
treeGrid.ColumnHeaderStyle.HorizontalAlignment = HorizontalAlignment.Center;
treeGrid.InternalGrid.ExpandGlyphType = GridTreeExpandGlyph.PlusMinus;

//Setting Width to FirstName column
treeGrid.Columns[1].Width = 150;
};


Please let us know if you need more details.

Thanks&Regards,
Raja sekar.G





102810attachement_ead5d4dc.zip

Sean Roddis
Replied On March 7, 2012 12:22 PM UTC

Hey,

its kind of curious.
If I use try to use:
GTC.Model.ColumnWidths[3] = 0;
in my Projekt, I get a "EntryPointNotFoundException".

But if I open ure Sample (http://www.syncfusion.com/downloads/Support/DirectTrac/88696/TreeGridBinding652655451.zip)
it works... even if I add new Columns and hide them.


Rajasekar G [Syncfusion]
Replied On March 7, 2012 01:15 PM UTC

Hi Roddis,

Width and ColumnWidth properties are working fine when we set in Code behind[C#] also. We have prepared the sample and code snippet for this. Please revert us with the modified sample if you are still facing the issue. Please refer attached image and sample program.

Code snippet:
//Setting default Width to column
this.treeGrid.DefaultColumnWidth = 50;

treeGrid.ModelLoaded += (s, e) =>
{
treeGrid.ColumnHeaderStyle.HorizontalAlignment = HorizontalAlignment.Center;
treeGrid.InternalGrid.ExpandGlyphType = GridTreeExpandGlyph.PlusMinus;

//Setting Width to FirstName column
treeGrid.Columns[1].Width = 150;
};


Please let us know if you need more details.

Thanks&Regards,
Raja sekar.G






102810attachement_a0e6cccb.zip

Sean Roddis
Replied On March 7, 2012 01:34 PM UTC

Hey again,

I found a way to handle my problem.

GTC.Column[n].width = 0;
GTC.Populate();

works.
So I think, my window or grid dont update right.


Rajasekar G [Syncfusion]
Replied On March 8, 2012 12:23 PM UTC

Hi Sean Roddis,

Thank you for your update.

Please let me know if you have any queries.

Thanks,
Raja sekar.G



Rajasekar G [Syncfusion]
Replied On March 8, 2012 12:24 PM UTC

Hi Sean Roddis,

Thank you for your update.

Please let me know if you have any queries.

Thanks,
Raja sekar.G



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.

Warning Icon 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.Close Icon

;