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.
Hello,
Would you please send me the full sample application because I do not know what exactly is your ViewModel and I am not able to reproduce your issue?
Looking forward to hearing from you.
I am still facing the same issue. for you help please find the attched files... here in code behind I am creating 3 level Headers... please check and let me know...
| Rates |
| Notional | PV01 |
|Gross | Net | Gorss | Net |
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
I have been looking into your issue and I have created a sample application(DataGridThemeIssue.zip) where I have added a field and an unbound field at runtime and the ‘Office2k7Black’ theme applies for both of them. Would you please modify it or send your sample application in order to provide your with more accurate assistance because the provided code is not enough to reproduce completely your scenario ?