Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
Temlated Column
posted

Hello, I created a templated Column with templates:

<Grids:TemplateColumn.ItemTemplate>
        <DataTemplate>
            <Grid>
                <Grid.Resources>
                    <BooleanToVisibilityConverter x:Key="BoolVisibilityConverter"/>
                    <FilterSet:EmptyConverter x:Key="ValueConverter"/>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="20"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Name, Converter={StaticResource ValueConverter}, Mode=OneWay}" Grid.Column="0" HorizontalAlignment="Stretch"  VerticalAlignment="Center" />
                <Buttons:ImageButton Command="{Binding ParameterSettingsCommand}" Visibility="{Binding HasSettings, Converter={StaticResource BoolVisibilityConverter}}" Grid.Column="1" Style="{StaticResource ImageButtonStyle2}" NormalSource="/AQUA.ClientServices.Presentation;Component/Documents/Styling/GUI_Components/Butt_Edit.png"/>
            </Grid>
        </DataTemplate>
    </Grids:TemplateColumn.ItemTemplate>
    <Grids:TemplateColumn.EditorTemplate>
        <DataTemplate>
            <Grid>
                <Grid.Resources>
                    <BooleanToVisibilityConverter x:Key="BoolVisibilityConverter"/>
                    <FilterSet:EmptyConverter x:Key="ValueConverter"/>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="20"/>
                </Grid.ColumnDefinitions>
                <TextBox Text="{Binding Name, Converter={StaticResource ValueConverter}, Mode=TwoWay}" Grid.Column="0" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
                <Buttons:ImageButton Command="{Binding ParameterSettingsCommand}" Visibility="{Binding HasSettings, Converter={StaticResource BoolVisibilityConverter}}" Grid.Column="1" Style="{StaticResource ImageButtonStyle2}" NormalSource="/AQUA.ClientServices.Presentation;Component/Documents/Styling/GUI_Components/Butt_Edit.png"/>
            </Grid>
        </DataTemplate>
    </Grids:TemplateColumn.EditorTemplate>

The problem is that when the cell in regular mode (not edit mode) , the TextBlock and Button doesn't fill all the cell. but when the cell is in edit , they fill the entire cell. What do i need to do in order the Cell Content to fill the entire cell?