OK, I'm having a heck of a time trying to find the magic incantations to make columns automatically size to their content.
Suppose I have three columns: "Size", "Mean" and "Sample Standard Deviation". I would like the Size and Mean columns to squeeze down to some minimum width, say 75 WPF pixels. But I would like the third column to expand to show the full text of the label.
"Autofit"only seems to make all columns the same width, which is not what I want.
As a bonus, I would also like to have each column automatically size to its data, so that if I entered "9999999999" in the size column, then the whole column would automatically grow larger to accommodate the new number.
Thanks,
Denny Huber
Perhaps so many people are having this problem because we can't find any information on a 'performautofit' method or even a 'column' object in the documentation.
I can find a 'column' property which returns an int. I don't think this is the object you're talking about.
Instead of being snotty, maybe you'd care to post some sample code. Or maybe a helpful link.
ThxTom
peryan77 said: If people want to autoize columns based on content then they should use the performautofit method of the column object when initializing the grid. Don't understand why so many people have this problem.
If people want to autoize columns based on content then they should use the performautofit method of the column object when initializing the grid. Don't understand why so many people have this problem.
"performautofit"? Care to expand on that one? I must be missing something...
Thanks,Michel
If people want to autoize columns based on content then they should use the
performautofit method of the column object when initializing the grid. Don't understand why so many people have this problem.
As recommended, I'm trying to set my initial column widths using a grid template as follows:
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings> <igDP:FieldLayoutSettings.DataRecordCellAreaGridTemplate> <ItemsPanelTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="50"/> <ColumnDefinition Width="80"/> <ColumnDefinition Width="130"/> ..... etc.
This works for the intial layout, but now the user can't resize the columns.
I've tried various combinations of AllowResize="True" in the FieldSettings and DataRecordSizingMode="IndividuallySizable" in the FieldLayoutSettings and AutoFit="True" in the grid properties, etc. I haven't found a combination that works. Is there a way to set the initial column widths to something other than some uniform '*' value and still let the users resize the columns to fit (since the grid can't do it)?
Hy Joe.
I am using Infragistics 8.1. I thought using DataRecordSizingMode will solve this problem with autowidth of the columns, but it's the same. Is this problem solved in this release or will it be in the future? Does Infragistics 8.1 have a solution for this?
Thanks a lot
Nico