Hi,
Manually reducing Column Width is not working for Hierarchical Data. Column width expansion(manual) works fine after setting Max Width. but reducing with is not working even after setting Min width. Here is my C# code and xaml code:
private Field CreateField(GridColumn gridColumn, Style styleVerticalLines){
Field fld = new Field();fld.Name = gridColumn.Column.ColumnName;fld.Label = gridColumn.Column.HeaderText;
FieldSettings _fieldSettings = new FieldSettings();
_fieldSettings.CellMinWidth = 10;_fieldSettings.LabelMinWidth = 10;_fieldSettings.Width = new FieldLength(width);_fieldSettings.CellMaxWidth = maxWidth;_fieldSettings.LabelMaxWidth = maxWidth;
_fieldSettings.CellValuePresenterStyle = styleVerticalLines;
fld.Settings = _fieldSettings;
return fld;}
<Style TargetType="{x:Type ig:CellValuePresenter}" x:Key="StyleVerticalLines"> <Setter Property="BorderBrush" Value="LightGray"/> <Setter Property="BorderThickness" Value="0,0,1,0"/> <Setter Property="Margin" Value="0,0,0,0" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="ContentTemplate" > <Setter.Value> <DataTemplate> <Grid Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type ig:CellValuePresenter}},Path=Width}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="!" Foreground="Red" HorizontalAlignment="Left" />
<TextBlock FontWeight="Bold" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding RelativeSource={RelativeSource
AncestorType={x:Type ig:CellValuePresenter}},Path=Value}" /> </Grid> </DataTemplate> </Setter.Value> </Setter> </Style>
Thanks,
Shakti
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks Stefan. your response on this thread solved my issue:
http://blogs.infragistics.com/forums/p/53090/276261.aspx
Hello Shakti,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your post. I have been looking into it, but it seems like I am missing something with it and I wasn’t able to reproduce your behavior, so if this is still an issue for you, could you please send me an isolated sample project, where this is reproduced, so I can investigate it further for you.
Looking forward for your reply.