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.
Please close the issue...
Thanks
Hello,
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
Would you please send me your runnable sample application because I cannot reproduce your scenario using the provided files ?
Looking forward hearing from you.
My ViewModel has nothing special and do not contribute a single line in View presentation which may cause theam change... My view model is just a class whcih expose collection..
Please find the attached file which contain collection and the class representation..
please let me know if it hels you..