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
990
Theam does not apply on UnBoundField
posted

I applied "Office2kBlack" theam  on XamDataGrid and created Fields and UnboundFields at runtime..

But looking it closely I can see that the Field background macthes with the "Office2kBlack" theam . But UnboundFiled looks like Old Windows 98 field or "LunaNormal"..

Note :- In My whole soulution i havent used any other Theam other then "Office2kBlack" .

 

XAML

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="_visiblerHeaderRowField">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Margin" Value="1,1,1,1"/>
            <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=Value, Converter={StaticResource _limitDetailConvertor}, ConverterParameter=ToolTipSet}"/>
            <EventSetter Event="MouseDown" Handler="CellValuePresenter_MouseDown"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                        <Grid Background="{TemplateBinding Background}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

   <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="_visiblerHeaderRowFieldLeft" BasedOn="{StaticResource _visiblerHeaderRowField}">
            <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Content.Definition.UpdateInformation}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                            <Grid Background="{TemplateBinding Background}">
                                <DockPanel LastChildFill="True">
                                    <igEditors:XamCurrencyEditor x:Name="_numberEditor"
                                           Background="Transparent" BorderBrush="Transparent" BorderThickness="0" VerticalAlignment="Center" HorizontalAlignment="Center"
                                           Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, Converter={StaticResource _limitAmountCurrencyConvertor},
                                        ConverterParameter=AmountText}" EditModeEnded="_numberEditor_EditModeEnded" EditModeStarted="_numberEditor_EditModeStarted" HorizontalContentAlignment="Left" VerticalContentAlignment="Center">
                                    </igEditors:XamCurrencyEditor>

<igDP:XamDataGrid Name="_grid" GroupByAreaLocation="None" Theme="Office2k7Black" FieldLayoutInitialized="_grid_FieldLayoutInitialized">
</igDP:XamDataGrid>

Code:

     for (int i = 0; i < keyValuePair.Value.Count; i++)
          {
            //LimitUsage limitUsage = keyValuePair.Value[i];
            //string isNet = keyValuePair.Value[i];// limitUsage.Definition.Net ? "Net" : "Gross";

            UnboundField unboundField = new UnboundField();
            unboundField.Settings.LabelTextAlignment = TextAlignment.Center;
            unboundField.Label = (keyValuePair.Value[i]) ? "Net" : "Gross";
            unboundField.Settings.CellValuePresenterStyle = (Style)this.Resources["_visiblerHeaderRowFieldLeft"];
            unboundField.Converter = new LimitSetupConvertor(keyValuePair.Key, keyValuePair.Value[i]);
            unboundField.Tag = headerField;
            unboundField.Column = headerField.Column + i;
            unboundField.Row = 1;
            unboundField.Settings.AllowEdit = true;
            unboundField.Name = headerField.Name + "_" + unboundField.Label;
            _grid.FieldLayouts[0].Fields.Add(unboundField);
            fields.Add(unboundField);
          }
          headerField.Tag = fields;

And I dont think headerPresenter has anything to do with Convertor. Please help Ui looks very very bad.

Parents Reply Children
No Data